Use rsync
It is really easy to setup. Just look at the rsync manpage
Get the ssl, sysuser modules for your thecus
Puiece of cake
Printable View
Use rsync
It is really easy to setup. Just look at the rsync manpage
Get the ssl, sysuser modules for your thecus
Puiece of cake
ok ill start to learn rsync... but will i have the same problems as before.. a folder which is 3TB in size wont transfer? my photo archive folder
p
no
Rsync dos it file by file, so it can sync and move onl;y changed files
So the problem will not happen
I think Thecus's is faster (nsync) because they don't have to create all the files during network transfer, but it also hits the 2tb limit.
I actually have a rsync script that lets me copy my raid shares, folder by folder to USB-mounted drives.
I plugged 2 2tb usb drives in and do the rsync backup to them every night (it updates changes only)
Glad to send it when I get home from my vacation if you'd like
i would really like to use your script, if thats ok
thanks for getting back in touch after your vacation
p
ok
I am back Thursday
I'd send it now but I turned my Thecus off while I was away.
phil
Here is the cmd file I use to rsync to my attached usb drives.
#!/bin/bash
#
# Backup to usb drives using rsync. Run usb_backup_init to remount usb drives r/w on new ports
#
# System is set to use only the first drive. Uncvomment the second to use it too
#
# Assumptions: Drives will have a signature file, 'usbdisk1.flg' and 'usbdisk2.flg' for drive 1 and 2
# Thus is used to allow the system to find the usb drives since usb is dynamic and mounted first come, first served
#
# At end, just place the locations of your shares to be backed up. They MUST have trailing slashes...
# To use drive 2 for some, just uncomment drive 2 discovery at topo and replace ${disk1} with ${disk2} in dest values.
#
# You must have loaded the following modules: SYSUSR, SSHD, RSYNC NTFS3G
#
#Subroutines here
#############################
writelocalog() {
if [ -z $1 ]
# Checks if any params.
then
echo No parameters passed to writelog
return 0
fi
echo USBBackup run on ${dt} > $1
echo From- ${infle} To- ${dest} >> $1
echo Logfile- ${logot} >> $1
echo $nothing >> $1
#tail -n 3 -q ${logot} >> $1
cat ${logot} >> $1
return 0
}
#
#########################################
#
#first check if drives mounted correctly
#
#Set backup log stuff based upon date
dt=`date +%Y%m%d%H%M%S`
fdt=`date`
#
logfl="backup_${dt}.log"
flogfl="backup.log"
#
#args to rsync
#rargs="-auvogpDEb"
rargs="-auogpDeb --stats"
#
RSYNC="/raid/data/module/RSYNC/system/bin/rsync_acl"
#
dsk1=''
if [ -f /raid0/data/usbhdd/usb/sdh1/usbdisk1.flg ]; then dsk1='sdh1';
else
{
if [ -f /raid0/data/usbhdd/usb/sdi1/usbdisk1.flg ]; then dsk1='sdi1';
else
{
echo 'Backup Drive 1 Signature NOT Found - Backup ending'
exit 1;
}
fi
}
fi
#dsk2=''
#if [ -f /raid0/data/usbhdd/usb/sdh1/usbdisk2.flg ]; then dsk2='sdh1';
# else
# {
# if [ -f /raid0/data/usbhdd/usb/sdi1/usbdisk2.flg ]; then dsk2='sdi1';
# else
# {
# echo 'Backup Drive 2 Signature NOT Found - Backup ending'
# exit 1;
# }
# fi
# }
#fi
#echo DISK=$dsk D2=$dsk2
#echo log=$logfl
#
#Do syncs...for now, all to $dsk1
#
#
dest="/raid0/data/usbhdd/usb/${dsk1}/KITS/"; infle="/raid0/data/KITS/"; logot="${dest}${logfl}"
echo Starting Backup of $infle to $dest
${RSYNC} ${rargs} --exclude '*~' ${infle} ${dest} > ${logot} 2>&1
writelocalog ${infle}${flogfl}
#
dest="/raid0/data/usbhdd/usb/${dsk1}/VIDEO/"; infle="/raid0/data/VIDEO/"; logot="${dest}${logfl}"
echo Starting Backup of $infle to $dest
${RSYNC} ${rargs} --exclude '*~' ${infle} ${dest} > ${logot} 2>&1
writelocalog ${infle}${flogfl}
#
dest="/raid0/data/usbhdd/usb/${dsk1}/PICTURES/"; infle="/raid0/data/PICTURES/"; logot="${dest}${logfl}"
echo Starting Backup of $infle to $dest
${RSYNC} ${rargs} --exclude '*~' ${infle} ${dest} > ${logot} 2>&1
writelocalog ${infle}${flogfl}
#
dest="/raid0/data/usbhdd/usb/${dsk1}/MUSIC/"; infle="/raid0/data/MUSIC/"; logot="${dest}${logfl}"
echo Starting Backup of $infle to $dest
${RSYNC} ${rargs} --exclude '*~' ${infle} ${dest} > ${logot} 2>&1
writelocalog ${infle}${flogfl}
#
dest="/raid0/data/usbhdd/usb/${dsk1}/PUBLIC/"; infle="/raid0/data/PUBLIC/"; logot="${dest}${logfl}"
echo Starting Backup of $infle to $dest
${RSYNC} ${rargs} --exclude '*~' ${infle} ${dest} > ${logot} 2>&1
writelocalog ${infle}${flogfl}
#
echo Backup USBBACKUP complete
echo USBBACKUP Last run was ${fdt} > /raid0/data/module/backuprun.txt
ok
Quick setup of this script:
From the SSH prompt, do the following:
mkdir /raid0/data/module/USBCOPY
mkdir /raid0/data/module/USBCOPY/system
mkdir /raid0/data/module/USBCOPY/system/etc
mkdir /raid0/data/module/USBCOPY/system/bin
copy my script into /raid0/data/module/USBCOPY/system/bin/usb_copy
cd into /raid0/data/module/USBCOPY/system/bin
chmod 755 usb_backup
edit the script end section to point to your shares. The ones listed are mine.
point the RSYNC line to point to the correct location for your rsync_acl file you installed
Mount a USB drive, go into df and make sure it mounted RW as sdi1 or sdh1
create a file on the drive named usbdisk1.flg. This is how the script sees the drive to use. so to do this:
cd /raid0/data/usbhdd/usb/sdh1 (or sdi1).
touch usbdisk1.flg
Then mkdir the output folders on this usb drive:
mkdir VIDEO
mkdir PICTURES
etc,etc for your output shares defined in the usb_backup script.
cd back to the system/bin you created above and try to run the script:
./usb_backup
It should just run, and will take a long time the first time.
To add to cron, so it runs every night:
do a 'crontab -l > a.a'
edit a.a and add the following line to the bottom of a.a
7 3 * * * /raid/data/module/USBBACKUP/system/bin/usb_backup > /dev/null 2>&1
Then run the following to add it officially: 'crontab a.a'
That will do it..