invalid command
can anyone help me? i try to make an autoscript for send the log file to my windows. i want to make this file run every 15 minutes. so i make file time_sch.txt
this is my autoscript file Code:
#/bin/bash |
??? of course we can't... how can we know what the issue is if we can't see the script??
|
can anyone help me? i try to make an autoscript for send the log file to my windows. i want to make this file run every 15 minutes. so i make file time_sch.txt
this is my autoscript file Code:
#/bin/bash Code:
[root@fedora ~]# chmod 755 autoscript Code:
[root@fedora ~]# bash ./autoscript |
gah, don't edit the original thread... how confusing is that?
|
The first line defines the interpreter incorrectly, you need
Code:
#!/bin/bash Also, it looks like you're trying to write to the root dir (of the disk, not root user's home dir). /httpfedora.net.id190120092001.txt: Cannot create file. You need to be careful where you run it from, or specify the path to write to (latter preferred for when its in cron, later) When using embedded vars in a value, I recommend using extra parentheses http$NAME$TIME.txt becomes http${NAME}${TIME}.txt try adding set -xv as the 2nd line in the shell file to see what's happening |
I wouldn't run a script I knew didn't work right as root...
at least, not without a recent backup! |
Do you have privileges to write to the root folder?
Looks like that is where your application is bombing! Linux Archive |
Try writing the file to some other folder where you have write privileges. That should do the trick.
:) |
Some of the error messages indicate the script might contain carriage return characters \r (also known as ^M).
This happens if a script is edited in Windows and then run in Linux. See this thread http://www.linuxquestions.org/questi...ory-461400/?s= |
Quote:
Code:
HOST='192.168.0.5' |
Why not just use cron?
|
All times are GMT -5. The time now is 10:14 PM. |