linux crontab error(command not found)
i am scheduling a command for a specific time every day.
Linux crontab format which i am using :- MIN HOUR DOM MON DOW CMD 30 08 10 06 * /home/mach/script.sh please tell me some presetting is required |
Hello,
Does the command run from the console? Are you running the command as a normal user or as root? If as user does that user have the permissions to execute every command in the script? What's showing in your log files in regards to the command? What's the script supposed to do? Can you post the contents of your script and output of Code:
ls -al <path/to/yourscript> Eric |
hi
Run the commend Quote:
|
@EricTRA :
I am running command from console as a normal user. command :-23 11 17 06 sed -f removeblankspace.sed demofile3 cat removeblanksapce.sed contents : /^$/d s/ */ /g If i run this command(sed -f removeblankspace.sed demofile3) independently then this is executing successfully. Output of ls -al command is : -rw-rw-r-- 1 mach mach 16 Jun 16 11:10 remblasp.sed @subho.d :- service crond restart bash: service: command not found crontab -l : no crontab for mach |
Hello,
Try putting sudo in front of your command: Code:
sudo <yourcommand> Post output when you ran the command with sudo. Kind regards, Eric |
Ok
run Quote:
|
u have the root acces ?
|
Hi,
Just noticed something, make the script executable: Code:
chmod +x remblasp.sed Code:
crontab -l Kind regards, Eric |
cron has a minimal default PATH setting; always provide the exact absolute path to all cmds and files used.
|
Hi,
Didn't even think of that one chrism01, thanks for pointing it out. Kind regards, Eric |
thanks
i executed my all commands at scheduled time successfully. But service crond restart gives me bash: service: command not found |
Hello,
Which Linux distro are you using? Debian, CentOS, RedHat? Kind regards, Eric |
Rhel5
|
Hi,
I assume you're running that restart command as normal user so can you try putting sudo in front of it? Code:
sudo service crond restart Eric |
All times are GMT -5. The time now is 12:55 AM. |