I’m trying to create backup cronjobs. When I run the same command in the console, its working. But when the cronjobs will be executed in crontab nothing happens.
Manually line:
/bin/tar -czf /var/backup_websites/weekly/all_websites.tar.gz /var/www
Cronjob line:
14 11 * * * /bin/tar -czf /var/backup_websites/weekly/all_websites.tar.gz /var/www
I did already change the timezone, this can’t be the problem. I think it is a problem with my permissions, but I did set permissions on 777 for the backup folders (backup_websites and weekly).
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!
Not sure if it’s the source of the problem but using sudo should not be necessary in this case (noticed it in the screenshot). As long as you add it by running crontab -e as root the task will be run as root.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.