SOLVED rsync only max 1 day old files to another FreeNAS

Status
Not open for further replies.

fips

Dabbler
Joined
Apr 26, 2014
Messages
43
Hi,

I was not sure which category is the right one for rsync questions, so I posted it here, correct me if I am wrong.
My Setup:
One main FreeNAS with about 20TB, second FreeNAS with just 2TB.
Every day I run write backup files to my main FreeNAS, approximately 500GB.
I want to sync that new data to the second FreeNAS, and just hold 1-2 generations.

Under Linux I would work with something like this script:
Code:
for i in `find /mnt/Backups/ -type f -ctime -1`
do
scp $i user@$second-FreeNAS:/mnt/OffsiteBackup
done


How could I achieve it with built in FreeNAS tools?
 

Artion

Patron
Joined
Feb 12, 2016
Messages
331
Have you considered using the Tasks tab? You ca use the Cron jobs or Rsync tasks.
upload_2017-8-16_15-32-6.png
 

fips

Dabbler
Joined
Apr 26, 2014
Messages
43
Yes I am trying to set up a cron job.
Code:
find /mnt/Backup/template/ -mtime 1 -print

Give the the right amount of files

But:
Code:
find /mnt/Backup/template/ -mtime 1 -exec rsync -av --delete -e ssh {} root@192.168.3.51:/mnt/OffBackup/ \;

copies older stuff too...

I don't know why...


and
Code:
find /mnt/Backup/template/ -mtime 1 -print | rsync -av --delete --files-from=- -e ssh root@192.168.3.51:/mnt/OffBackup/

throw an error...
 

Artion

Patron
Joined
Feb 12, 2016
Messages
331
Is this solved? If it is, consider editing the post as Solved. Look at this or this on how to do it.
 

fips

Dabbler
Joined
Apr 26, 2014
Messages
43
sure, I forgot to mark it. Problem was that I had to specify that only files are synced. otherwise the -a flag goes recursive thru all files.
 
Status
Not open for further replies.
Top