Can someone please give me some thoughts on how I can schedule:
* Mount a USB drive
* Rsync a few local folders/files (what does rsync do when full?)
* Unmount the USB
Just want to copy off my time mahcine backups, photos and config.xml once a week/day.
Thankyou
Paul
This is the old XigmaNAS forum in read only mode,
it will taken offline by the end of march 2021!
I like to aks Users and Admins to rewrite/take over important post from here into the new fresh main forum!
Its not possible for us to export from here and import it to the main forum!
it will taken offline by the end of march 2021!
I like to aks Users and Admins to rewrite/take over important post from here into the new fresh main forum!
Its not possible for us to export from here and import it to the main forum!
Automate Rsync to USB
-
horsi
- NewUser

- Posts: 11
- Joined: 10 Aug 2012 06:03
- Status: Offline
Re: Automate Rsync to USB
Put this together - tested as a cron job - can anyone see any problems with it?
Thanks
Paul
Thanks
Paul
Code: Select all
mkdir /mnt/usbbak
mount /dev/da0p1 /mnt/usbbak
rsync -azv /mnt/Timemachine/Sysconfig /mnt/usbbak
rsync -azv /mnt/Timemachine/Sysbackups /mnt/usbbak
rsync -azv /mnt/Timemachine/Home /mnt/usbbak
umount /mnt/usbbak
rm -r /mnt/usbbak-
ponyslaystation
- NewUser

- Posts: 5
- Joined: 08 Oct 2012 03:14
- Status: Offline
Re: Automate Rsync to USB
It's a real shame no one can be bothered confirming if this would work
I did see in the scripting section(?) there is a post on automating this process, but it is a huge script that has no real instructions for the layman.
Even if you look in the scripting section on how to setup and run a script, all it says is learn to script! sheesh.
And what about the Wiki?
Q: Can I automatically backup my data to external, USB drives that mount automatically?
A: Yes, but since you want everything to be automatic you will have to learn about scripting.
What a joke.
I would have thought that this would be a feature that would popular and easily implemented.
Don't get me wrong, I think nas4free is an awesome piece of software, i just wish you didn't a IT degree to auto mount a usb drive!
I did see in the scripting section(?) there is a post on automating this process, but it is a huge script that has no real instructions for the layman.
Even if you look in the scripting section on how to setup and run a script, all it says is learn to script! sheesh.
And what about the Wiki?
Q: Can I automatically backup my data to external, USB drives that mount automatically?
A: Yes, but since you want everything to be automatic you will have to learn about scripting.
What a joke.
I would have thought that this would be a feature that would popular and easily implemented.
Don't get me wrong, I think nas4free is an awesome piece of software, i just wish you didn't a IT degree to auto mount a usb drive!
-
horsi
- NewUser

- Posts: 11
- Joined: 10 Aug 2012 06:03
- Status: Offline
Re: Automate Rsync to USB
I can confirm this works - just format the usb device first to ext. The beauty of Rsync means that you can also back data up from or two remote servers with a command like
From remote server
To remote server
Just need to setup SSH certificates to be able to automate this which is a whole other story - on the flip side I use this command to move all the data off my old server over the my new one 
Paul
From remote server
Code: Select all
rsync -e ssh -av username@192.168.1.1:/mnt/remotedata /mnt/localdataCode: Select all
rsync /mnt/localdata-e ssh -av username@192.168.1.1:/mnt/remotedataPaul
-
ponyslaystation
- NewUser

- Posts: 5
- Joined: 08 Oct 2012 03:14
- Status: Offline
Re: Automate Rsync to USB
So if i wanted to run this script as a cron job, how would i do that?
create a txfile with the above commands in it, name it something like backup.sh , chmod it....
then, um Im a little lost. how do i tell cron to run this?
cheers
OK, think i figured it out
i Put this in a file called /scripts/usbbackup.sh
then in my cron job i put: /scripts/usbbackup.sh
and it worked! BUT, how do i get my rsync to verbose to a log file?
cheers
create a txfile with the above commands in it, name it something like backup.sh , chmod it....
then, um Im a little lost. how do i tell cron to run this?
cheers
OK, think i figured it out
i Put this in a file called /scripts/usbbackup.sh
Code: Select all
mkdir /mnt/usbbackup
mount /dev/da4p1 /mnt/usbbackup
rsync -azv /mnt/Blackhole /mnt/usbbackup
umount /mnt/usbbackup
rm -r /mnt/usbbackupand it worked! BUT, how do i get my rsync to verbose to a log file?
cheers
-
horsi
- NewUser

- Posts: 11
- Joined: 10 Aug 2012 06:03
- Status: Offline
Re: Automate Rsync to USB
You got it.
Re the output maybe you could run something like this
rsync -av /from/here /to/here > /log/file/here.txt
test it at the command line and see how you get on.
Paul
Re the output maybe you could run something like this
rsync -av /from/here /to/here > /log/file/here.txt
test it at the command line and see how you get on.
Paul
-
ponyslaystation
- NewUser

- Posts: 5
- Joined: 08 Oct 2012 03:14
- Status: Offline
Re: Automate Rsync to USB
I think I'm getting the hang of this
This is now my rsync line:
What if i want more than 1 rsync line? is it possible for the next line to append the log file?
Also is it possible to write a log with the date in it eg, rsynclogDDMMYY ??
ok got this working with:
Now about that append....
Cheers
This is now my rsync line:
Code: Select all
rsync -azv --log-file=/logs/rsynclog /mnt/Blackhole /mnt/usbbackupAlso is it possible to write a log with the date in it eg, rsynclogDDMMYY ??
ok got this working with:
Code: Select all
rsync -azv --log-file=/logs/rsync-`date "+%Y.%m.%d.%H.%m."`log /mnt/Blackhole /mnt/usbbackupCheers