Question

Crontab not working or shell scripts wrong setup?

  • Posted November 11, 2013

Hello! I tried to setup a cronjob with crontab to run a shell script every 10 minute. But it´s not working. The Shell Script file: " #!/bin/bash

Remove Files

rm -f /var/log/messages "

The Crontab -E Config file: " */10 * * * * /vpndel/script "¨

But when i check the log file the text is still there after 10 minutes have gone?

What could be wrong?

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Are its permissions set properly? Try running <code>chmod +x /vpndel/script</code>.

Perhaps these might be helpful: <br> <br>1.) <a href=“https://digitalocean.com/community/articles/how-to-write-a-simple-shell-script-on-a-vps”>How To Write a Simple Shell Script on a VPS</a>; <br> <br>2.) <a href=“https://digitalocean.com/community/articles/how-to-write-a-simple-shell-script-on-a-vps-part-2”>How To Write a Simple Shell Script on a VPS (Part 2)</a>; <br> <br>3.) <a href=“https://digitalocean.com/community/articles/how-to-write-a-simple-shell-script-on-a-vps-part-3”>How To Write a Simple Shell Script on a VPS (Part 3)</a>; <br> <br>4.) <a href=“https://digitalocean.com/community/articles/how-to-use-a-simple-bash-script-to-restart-server-programs”>How To Use a Simple Bash Script To Restart Server Programs</a>.