Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
65
rated 0 times [  65] [ 0]  / answers: 1 / hits: 87521  / 2 Years ago, sun, october 2, 2022, 10:21:27

I want to do one way synchronization.



I am having Folder A on my computer which is constantly updated with content.

Another Folder B is used for backup purpose which is on external HDD.



Now what I expect is that whatever extra which is present in folder A should go to folder B. However something which is present in B and NOT in A ""shall NOT be copied to A"".



In a nutshell, the backup folder may copy everything from the source folder, however nothing should be copied form backup folder to the source.


More From » backup

 Answers
4

Sounds like a perfect task for rsync



sudo rsync -az /path_to/A /path_to/B



-a archive mode (implies recursive, copy symlinks as symlinks, preserve owner, modification times, group, owner, special and device files)



-z compresses the data




If you wish to remove files deleted in A from files in B, use the --delete option



For additional information see:



https://help.ubuntu.com/community/rsync



You can run rsync from cron



sudo crontab -e


Add in an hourly task



@hourly rsync /path_to/A /path_to/B


https://help.ubuntu.com/community/CronHowto


[#37822] Monday, October 3, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
allally

Total Points: 487
Total Questions: 106
Total Answers: 110

Location: Laos
Member since Sun, Jul 3, 2022
2 Years ago
;