Report this

What is the reason for this report?

Crontab not working or shell scripts wrong setup?

Posted on 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?



This textbox defaults to using Markdown to format your 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.

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>.

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

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.