cron and crontab problem

I´ve create this file : /home/user/  (rwxr-xr-x).

shutdown -r now

Edited the crontab file with crontab -e command.
inserted this line :

30 14 * * * /bin/sh /home/user/

But the computer didn´t restart. What I´m doing wrong /
I´m using Debian Wheezy
Jose BredariolPMPAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David FavorLinux/LXD/WordPress/Hosting SavantCommented:
Keep in mind, this will only work in the root CRON file, never a non-super user account.

Only root (and other admin accounts) have privilege to run shutdown.
nociSoftware EngineerCommented:
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.)
David FavorLinux/LXD/WordPress/Hosting SavantCommented:
I'm with noci. Not a requirement + using /sbin/shutdown ensures no other shutdown command in $PATH gets picked up.

This is unlikely + if it does occur, it's a nightmare to debug.

Absolute/Full paths are your friend.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jose BredariolPMPAuthor Commented:
Thanks all
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.