Rsync creation of separate dated folders, automatic saves and date appending

allanl9

Cadet
Joined
May 8, 2019
Messages
7
Is there a command string to get rsync to -

1 Copy files from one FreeNAS server to another and append a date stamp so saved files will have the date appended to avoid ongoing overwrite of the prior files?

2 Do the same, but have rsync create a daily folder and copy that day's files into it before creating the next day and so on?

Thanks,
 

garm

Wizard
Joined
Aug 19, 2017
Messages
1,556
Why would you want that? Why not just have rsync copy all your data to one location and take snapshots before or after each copy job?
 

allanl9

Cadet
Joined
May 8, 2019
Messages
7
I don't want to use snapshots for this application. So is there a command to be appended to the FreeNAS rsync tasks to -

1 Copy files from one FreeNAS server to another and append a date stamp so saved files will have the date appended to avoid ongoing overwrite of the prior files?

2 Do the same, but have rsync create a daily folder and copy that day's files into it before creating the next day and so on?

Thank you,
 

garm

Wizard
Joined
Aug 19, 2017
Messages
1,556

allanl9

Cadet
Joined
May 8, 2019
Messages
7
We are getting there. I know that rsync will overwrite. Can the GUI be used to create the basic push/pull and a command line be appended on the line on the task page? If so, what are they - add date to each copies file in which case it's not necessary to create folders or create a new folder a midnight and copy that day's files into it and so on? Thank you.
 

garm

Wizard
Joined
Aug 19, 2017
Messages
1,556
I’m fairly sure you won’t be able to do that without breaking the UI. Maybe you can override the destination field in the task with the extra option field, but I’m almost sure you need to specify an existing folder.

Otherwise just write a script based on the answer at serverfault and place it on a pool, have it copied by a post unit task to /root and set a task to execute it at what ever interval.
I do this with application backups from my jail pool to my storage pool, only I use snapshots to have incremental backups.
 

allanl9

Cadet
Joined
May 8, 2019
Messages
7
Okay, thank you. I hope that a future FreeNAS release will offer check-boxes to accomplish both.
 

garm

Wizard
Joined
Aug 19, 2017
Messages
1,556
i wouldn’t hold my breath, it’s fairly complicated compared to a straight Rsync Task and the usecase is questionable
 

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
I'm not certain I understand the first question in the original post. By default, rsync synchronizes files in two locations - it only copies files that have changed.

You can run rsync with the following command: rsync -avh --progress
"a" will run in archive mode
"v" will run in verbose mode
"h" specifies human readable format for output list
--progress will provide a list of files as they are copied.

For example, rsync -avh --progress /mnt/data1/media/Movies /mnt/backup1/ will synchronize the directory "Movies" from the original location "mnt/data1/media/Movies" to the output location "mnt/backup1/Movies. This command also lists the files as they are copied.
 
Top