Progrider

Programming discussion

Board index
Help · Open discussion

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.
-n first. Always. With --delete, every time.
got most of it back with photorec, filenames are gone though. using -n from now on. dont say anything lintroller

Add a reply

Plain text. Public, and removed when the thread expires.

Posts and requests are logged for research. Privacy notice.