crontab sh issues
Simply put, crontab throws the "No such file" exception when creating a job to run a bash script @reboot. Here's what I did:
Created this script: #!/bin/bash clear cd /home/admin echo "Initializing..." /home/admin/proc_ret.sh Then, chmod 755 to change permissions to executable Then, simply: crontab @reboot /home/admin/script.sh, which throws the exception. I've also tried: crontab * * * * * @reboot... and crontab sh /home/admin/script.sh (this doesn't throw an exception, but it doesn't create a task, i.e. crontab -l shows nothing. ANY IDEAS? |
Quote:
To setup a crontab entry you run "crontab -e" which puts you into an edit (vi) session. You then input your detailed entry: Code:
@reboot /home/admin/script.sh That adds the entry to the crontab file in /var/spool/cron for the user you ran the command as. (e.g. /var/spool/cron/root if you did it as the root user.) The @reboot per "man 5 crontab" replaces the standard 5 date/time specifications so you don't add the * * * * * in addition to the @reboot. |
Thanks
Thanks - yes, I realize now that I missed that essential step!
Thanks, *thread closed* |
Personally, I would chmod 700
No reason for anyone but owner (admin?) Execute (or read ) it Of course, root will also be able to do what it wants with said script |
All times are GMT -5. The time now is 07:34 PM. |