I'm with you on the lack of UI interface for a non-interactive backup to a USB drive.
I'm using RAID1, and wanted to backup my volume_1 to an external drive.
I ended up using "rsync" via "fun_plug".
I'd already put "fun_plug" on in order to install Twonky, so it was just a matter of connecting via SSH through Putty, running "rsync" to the USB mount and letting it run to completion.
Command used:
rsync -avh --del /mnt/HD/HD_a2/* /mnt/USB/HD_c1/ --progress
Using --del so any files I remove from Volume_1 will also be removed from the USB drive keeping both devices sync'd.
-----
Initially, the first backup took a long time because the USB drive was empty and had to copy everything over, plus the fact I had to do it via Putty on a client machine which needed to remain on. I didn't try "nohup" admittedly.
However, as it's a sync tool, subsequent backups (via the same command and to the same USB drive) will skip the files that already exist or are unchanged, and will only copy the newer/modified stuff so it will be much quicker.
You can do the backup in several stages instead of letting it run continuously, by issuing the command, letting it run for a few hours, killing it, and then running it again another day, as it will skip the files it already copied previously.
-----
I've now set rsync to run via "cron" (fun_plug and uwcron) every Monday morning at 9am, so it's like an incremental backup to the USB drive, and it will print the output to a log so I can check for any failures.
crontab entry (contained in /ffp/etc/cron.d/mondaybackup.cron) is:
0 9 * * 1 /mnt/HD/HD_a2/backup.sh
I'm no developer so it's not perfect, but my backup.sh script contains the rsync command amongst other things such as printing to a log:
#!/ffp/bin/sh
# Set log location
logfile=/mnt/HD/HD_a2/BACKUP.log
# Create a backup timestamp file onto USB disk
printf "This drive contains a backup of NAS Volume_1 taken at: `date +'%d %b %Y - %H : %M'`" > /mnt/USB/HD_c1/BACKUP.date
# Rsync command
/ffp/bin/rsync -avh --del /mnt/HD/HD_a2/* /mnt/USB/HD_c1/ --progress > $logfile
exit_code=$?
# Did it fail?
if [ $exit_code -ne 0 ] ; then
# Print failure message to log and timestamp file
printf "\nBackup failed\n" >> /mnt/USB/HD_c1/BACKUP.date
printf "\nBackup failed\n" >> $logfile
else
# Print success message to log and timestamp file
printf "\nBackup completed successfully\n" >> /mnt/USB/HD_c1/BACKUP.date
printf "\nBackup completed successfully\n" >> $logfile
fi
I also print the date and "success/failure" message to a timestamp file on the USB drive. This is in case I decide to switch USB drives for multiple copies. At least with a timestamp file, I will be able identify when the backup was taken, and if it was successful or not.
If I want to check the progress of a backup while it's running, I can SSH to the NAS via Putty, and run:
tail -f /mnt/HD/HD_a2/BACKUP.log
UPDATE: I've since added msmtp command so it now emails me when the backup has started and again when it's finished. If the backup fails, the email also contains the last 50 lines of my backup log, so now it's all automated every Monday morning while I'm at work, and it notifies me when it's done and if it worked or not.
This will suffice for me, at least until I have sufficient funds for a second NAS.