Jose Bredariol
asked on
cron and crontab problem
I´ve create this file : /home/user/rest.sh (rwxr-xr-x).
-------------------------- ----
#!/bin/bash
#rest.sh
shutdown -r now
-------------------------- ---
Edited the crontab file with crontab -e command.
inserted this line :
30 14 * * * /bin/sh /home/user/rest.sh
But the computer didn´t restart. What I´m doing wrong /
I´m using Debian Wheezy
--------------------------
#!/bin/bash
#rest.sh
shutdown -r now
--------------------------
Edited the crontab file with crontab -e command.
inserted this line :
30 14 * * * /bin/sh /home/user/rest.sh
But the computer didn´t restart. What I´m doing wrong /
I´m using Debian Wheezy
Unprivileged user cannot do this,
either you need to use sudo (as an admin account) to run reboot /shutdown -r , or install this entry under the root user.
Also be aware that the regular path is NOT available in active cron jobs.
It is a good practice to qualify the command with full pathname.
shutdown is also in /sbin which might not be in the default path...
(You should receive a mail upon failure.)
either you need to use sudo (as an admin account) to run reboot /shutdown -r , or install this entry under the root user.
Also be aware that the regular path is NOT available in active cron jobs.
It is a good practice to qualify the command with full pathname.
shutdown is also in /sbin which might not be in the default path...
(You should receive a mail upon failure.)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks all
Only root (and other admin accounts) have privilege to run shutdown.