I have a backup script that runs on CRON that I developed about 5 years ago. It has always worked perfectly but a recent firmware update on my QNAP TS 259 has seem to break the large file move/copy capability amongst the ESATA drives.
I would like to just change my backhup.sh so that writes to two locations at once, instead of writing to one location then using CP to copy it to another location.
#!/bin/sh
####################################
#
# Backup to eSATA on NAS TS259.
#
####################################
# What to backup.
backup_files="/share/video/. /share/music/. /share/Web/. /share/tempdownload/. /share/Data/. /share/sheri.mccormack/. /share/pictures/. /share/Documents/. /share/charlie.mccormack/. /share/sydney.mccormack/. /share/persvideo/."
# Where to backup to.
dest1="/share/eSATADisk1/"
dest2="/share/eSATADisk2/"
#dest3=""
#dest4=""
# Create archive filename.
day=$(date +%Y%m%d-%H%M%S)
hostname=$(hostname -s)
archive_file="$hostname-$day.tgz"
# Print start status message.
echo "Backing up $backup_files to $dest/$archive_file"
date
echo
# Backup the files using tar.
#tar czfP $backup_files | tee $dest1/$archive_file $dest2/$archive_file
#tar czfP $dest2/$archive_file $backup_files
cp -rfpv $dest2/* $dest1/
# cp script for moving stuff around
#cp -rfpv $dest3/*.* $dest4/
# Print end status message.
echo
echo "Backup finished"
date
I also use this file to just move stuff around by adding and removing the # signs. So above were I do the tar command I assume I could write to two locations at the same time. Just not sure how to do it.
Any help greatly appreciated.