You are not logged in.

#1 2021-03-09 02:15:37

manouchk
Member
Registered: 2008-07-29
Posts: 306

[solved] recovering a filesystem spanned in two different directory

Hi,

Few weeks ago, I (unfortunatly) simultaneously used rmlint on two synchronized directory in order to remove duplicated files (one hard drive was full). This led to removed distinct files that were removed on the cloud! Both directory were synchronized on the same cloud and removed file were differents. That's a bad combination, I did not think about before!). Then I had to recover the cloud at an older time and putted this old version of my file in a directory named Sync-old. The Synced directory is named Sync.

I was thinking of using rsync -ua Sync-old Sync

but it looks like I cannot trust modification times in this case, so this does look like a good option.

I should use an option for which file of Sync-old cannot modify existing file in Sync.

I also thought about unison but I'm not sure of what to do.

I thought that a possibility may be:

unison  Sync-old Sync   -nocreation Sync-old  -nodeletion Sync  -noupdate Sync

but this does not work. It gives the following error message:

Unison 2.51.2 (ocaml 4.11.0): Contacting server...
Fatal error: Wrong number of roots: 2 expected, but 4 provided (Sync-old, Sync, Sync, Sync-Rewind)
(Maybe you specified roots both on the command line and in the profile?)

WOuld that be correct for my case and this really written like that?

Then I would have to run rmlint but this is the next step.

-nocreation xxx    prevent file creations on one replica
-nodeletion xxx    prevent file deletions on one replica
-noupdate xxx      prevent file updates and deletions on one replica


Then I should rum rmlint or smething else in order to reduce duplicates files.

I'm afraid of doing a new mistake.

Last edited by manouchk (2021-04-08 13:52:06)

Offline

#2 2021-03-09 08:09:10

respiranto
Member
Registered: 2015-05-15
Posts: 479
Website

Re: [solved] recovering a filesystem spanned in two different directory

manouchk wrote:

but it looks likeI cannot trust  modification times so this does look like a good option.

Why not?

Anyways,

rsync --ignore-existing --other-args Sync-old/ Sync/

should work.  Note the slash after `Sync-old'.

I generally do not use only `-a', but `-rptogAXlHS --numeric-ids'.  However, the former may be sufficient in your case.

Note that I assume that no file was corrupted, but only files deleted.  If you doubt this, you could use rsync's `--link-dest' option to save both trees safe-efficiently next to one-another.  Assuming that your synchronization program supports hardlinks.

Edit: Should be `--ignore-existing', not `--ignore-missing'.

Last edited by respiranto (2021-03-09 08:10:42)

Offline

#3 2021-03-27 11:21:39

manouchk
Member
Registered: 2008-07-29
Posts: 306

Re: [solved] recovering a filesystem spanned in two different directory

respiranto wrote:
manouchk wrote:

but it looks likeI cannot trust  modification times so this does look like a good option.

Why not?

I did resgate old file from cloud and dates are all uniform in the directory. It does not seem to have kept modification time.

Anyways,

rsync --ignore-existing --other-args Sync-old/ Sync/

should work.  Note the slash after `Sync-old'.

I generally do not use only `-a', but `-rptogAXlHS --numeric-ids'.  However, the former may be sufficient in your case.

Note that I assume that no file was corrupted, but only files deleted.  If you doubt this, you could use rsync's `--link-dest' option to save both trees safe-efficiently next to one-another.  Assuming that your synchronization program supports hardlinks.

Edit: Should be `--ignore-existing', not `--ignore-missing'.

There is also a slash after Sync/ ?

Offline

#4 2021-03-27 11:28:53

manouchk
Member
Registered: 2008-07-29
Posts: 306

Re: [solved] recovering a filesystem spanned in two different directory

Shouldn't it be:

rsync --ignore-existing --other-args Sync-old/* Sync/

Offline

#5 2021-03-27 11:40:53

manouchk
Member
Registered: 2008-07-29
Posts: 306

Re: [solved] recovering a filesystem spanned in two different directory

I tried:

rsync --dry-run --ignore-existing -rptogAXlHS --numeric-ids Sync-Rewind/ Sync/

but it returned nothing! I don't understand. I should get a huge list of files.

Offline

#6 2021-03-28 02:05:39

manouchk
Member
Registered: 2008-07-29
Posts: 306

Re: [solved] recovering a filesystem spanned in two different directory

respiranto wrote:
manouchk wrote:

but it looks likeI cannot trust  modification times so this does look like a good option.

Why not?

Anyways,

rsync --ignore-existing --other-args Sync-old/ Sync/

should work.  Note the slash after `Sync-old'.

I generally do not use only `-a', but `-rptogAXlHS --numeric-ids'.  However, the former may be sufficient in your case.

Note that I assume that no file was corrupted, but only files deleted.  If you doubt this, you could use rsync's `--link-dest' option to save both trees safe-efficiently next to one-another.  Assuming that your synchronization program supports hardlinks.

Edit: Should be `--ignore-existing', not `--ignore-missing'.

I just run the rsync line you suggested. Thank you. Then I rum rmlint to remove duplicates preserving files in Sync directory.

Offline

#7 2021-03-28 15:15:54

respiranto
Member
Registered: 2015-05-15
Posts: 479
Website

Re: [solved] recovering a filesystem spanned in two different directory

manouchk wrote:

There is also a slash after Sync/ ?

Which does not matter (much).

Shouldn't it be:

rsync --ignore-existing --other-args Sync-old/* Sync/

This would work as well, unless you have files in `Sync-old/' starting with a dot (<.>).  See rsync(1) on the difference of `dir' and `dir/' as source argument.  Note that this behaviour is different for most other common programs.

I tried:

rsync --dry-run --ignore-existing -rptogAXlHS --numeric-ids Sync-Rewind/ Sync/

but it returned nothing! I don't understand. I should get a huge list of files.

To get verbose output, include `--verbose' in the arguments.  `--dry-run' does not imply it.

I just run the rsync line you suggested. Thank you. Then I rum rmlint to remove duplicates preserving files in Sync directory.

Glad I could help.

Offline

#8 2021-04-08 13:54:33

manouchk
Member
Registered: 2008-07-29
Posts: 306

Re: [solved] recovering a filesystem spanned in two different directory

Thank you for the additional informations!

Offline

Board footer

Powered by FluxBB