So i created a script used to backup system, i tested and it worked. Here's the script:
#!/bin/bash backup_files="/home /var/spool/mail /etc /root /boot /opt" dest="/mnt/backup" day=$(date +%F) hostname=$(hostname -s) archive_file="$hostname-$day.tgz" echo "Backing up $backup_files to $dest/$archive_file" date echo tar czf $dest/$archive_file $backup_files echo echo "Backup finished" date ls -lh $dest
But when put it in crontab , it didn't work. I used "crontab -e" and put this following command line in there
* * * * * /root/backup_system.sh
I waited and nothing happend. I don't know where i was wrong. @I'm running Ubuntu 14.04, the script was changed permission using chmod.