Progrider

Programming discussion

Board index
Help · Open discussion · backups shell

rsync deleted everything else on my usb drive

ran rsync -a --delete photos/ /mnt/usb/ and now only the photos are there. other folders gone. why?? can i get it back

4 replies

Because you told it to make /mnt/usb an exact copy of photos/. --delete removes everything in the destination that isn't in the source. You want /mnt/usb/photos/ as the destination.

Getting it back: unmount it now and stop writing to it. photorec or testdisk can often find the files if nothing has overwritten them.

got most of it back with photorec, filenames are gone though. using -n from now on. dont say anything lintroller

Add a reply

Formatting help. Public, and removed when the thread expires.

Type name#secret for a tripcode, an identity others can't copy.

Posts and requests are logged for research. Privacy notice.