Sync 2 Folders

Post here if you are a new Porteus member and you're looking for some help.
User avatar
FURRY_NOVA
Black ninja
Black ninja
Posts: 84
Joined: 11 Aug 2016, 17:26
Distribution: Porteus XFCE v3.2 i586
Location: United Kingdom

Sync 2 Folders

Post#1 by FURRY_NOVA » 29 Aug 2016, 02:07

Is there a module GUI application or a terminal command to sync 2 folders of their content to match the first one? I tend to do a lot of file managing (renaming, moving, adding and deleting) while keeping one as a backup on another device.

I'm asking since it's difficult having 2 Thunar tabs/windows open and performing a lot of same changes on both devices. Doing a full delete of the secondary folder and a full copy to replace isn't healthy for the USB devices I imagine specially greater than 10gb. So I imagine it's better having a function to read and compare files to write changes.

Basically what is in the master folder is on the secondary, what isn't in the master folder isn't on the secondary and both file versions are the same.

If it's a terminal command, for safety, something to print a list of changes before performing the actions would be great.
New to Linux but learning. Hoping to help out Porteus community. :)

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Sync 2 Folders

Post#2 by brokenman » 29 Aug 2016, 03:03

rsync was designed for this. A quick duckduckgo search will bring up loads of tutorials. For a gui use USM to download grsync.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
FURRY_NOVA
Black ninja
Black ninja
Posts: 84
Joined: 11 Aug 2016, 17:26
Distribution: Porteus XFCE v3.2 i586
Location: United Kingdom

Re: Sync 2 Folders

Post#3 by FURRY_NOVA » 29 Aug 2016, 21:29

Edit: I managed to solve the issue. I used this in the terminal and it updated everything in seconds.

Code: Select all

rsync --progress --modify-window=1 --update --delete --recursive --times "/mnt/sdb1/source folder/" "/mnt/sdc/destination folder/"
Although grsync which I was using was the overall problem. The perimeters are the same and it hangs overwriting everything with same settings for ages.
New to Linux but learning. Hoping to help out Porteus community. :)

Post Reply