I wrote a backup script for our local dev server (running Ubuntu server edition 9.10), just a simple little script for tar and gzip local root and paste it into the backup folder. It works fine when I run:
$ bash backups.sh
but it does not work when I run it through crontab.
59 23 * * * bash /home/vnc/backups/backup.sh >> /home/vnc/backups/backup.log 2> $1
I get an error
/bin/sh: cannot create : nonexistent
The script does tar.gz in the folder in which it is running (/ home / user1), but then tries to copy it to the mounted share (/ home / backups, which is really 192.168.0.6/backups) from the network drive using fstab. The installed share has 777 permissions, but the owner and group are different from those who run the script. I use bash to run a script instead of sh to get around another problem that I had in the past with "bad replacement" errors
The first 2 lines of the file
cd /home/vnc/backups
I probably did not provide enough information to fully respond to this post, but I can post additional information as necessary, but I do not know where to look further.
source
share