Bash Script - Breaks with Cron
by goldennuggets from LinuxQuestions.org on (#4Z815)
I'm running Kubuntu.
I've written a bash script that backs up my configuration files, 7zips them, uploads the archive to dropbox, and then deletes the local archive.
It runs beautifully.
I then added a cron job to have this script executed weekly. It always places the 7zip file in my home directory and then the file doesn't get uploaded. I've tried using absolute directory references rather than relative ones all to no avail.
It runs fine when I manually execute it. But it breaks when cron runs it.
It's driving me mad! Has anyone else experienced this and do you have any help/suggestions/tips/answers as to how to make the script work when it's run as a cron job?


I've written a bash script that backs up my configuration files, 7zips them, uploads the archive to dropbox, and then deletes the local archive.
It runs beautifully.
I then added a cron job to have this script executed weekly. It always places the 7zip file in my home directory and then the file doesn't get uploaded. I've tried using absolute directory references rather than relative ones all to no avail.
It runs fine when I manually execute it. But it breaks when cron runs it.
It's driving me mad! Has anyone else experienced this and do you have any help/suggestions/tips/answers as to how to make the script work when it's run as a cron job?