Bash help

Soldato
Joined
21 Oct 2002
Posts
14,595
Location
Wellington, NZ
Hi all. I'm trying to back up everything on my 2TB NAS to a 2TB USB HDD. Obviously with something like a QNAP or Synology this would be straight forward but I'm stuck with an old Seagate GoFlex home and the GUI is pretty awful. There isn't a backup option.

I've gained root access via putty and i'm running this command:

cp -u -r --preserve=all /home/admin/"nas-sharename"/* /home/admin/"usb-sharename"/

The problem I've got is the USB drive is running out of space. The destination files are bigger than the source files:confused: I'm running treesize on the USB drive now to see where the duplicates are but does anyone know if I can add any extra switches in to my command to fix it without manually searching for duplicates? Are deleted files from the NAS potentially not being deleted from the USB drive?

edit: would I be better using rsync rather than cp?
 
Last edited:
If it's deleted on the NAS, cp will not delete the file on the USB, it's only going to add files to the USB that don't exist or are newer on the NAS (the -u option).

I think rsync is what you'll want.
 
Like others have said, rsync.

I use this to backup folder/files ect via ssh on my home server.

Code:
rsync -r -a -v -e ssh "src" user@host:"dest"
 
It's a Seagate Goflex Home 2TB which I think runs hipserv 2.7.

It's pretty old and pretty terrible. Single disk/no RAID. It's only really used for Plex storage so no critical data on it.

Having said that, if I did have redundancy and rsync I'd probably keep some important files/photos on it, hence looking at potentially upgrading to a Synology DS216SE.
 
Last edited:
It's a Seagate Goflex Home 2TB which I think runs hipserv 2.7.

It's pretty old and pretty terrible. Single disk/no RAID. It's only really used for Plex storage so no critical data on it.

Having said that, if I did have redundancy and rsync I'd probably keep some important files/photos on it, hence looking at potentially upgrading to a Synology DS216SE.

Upgrade may be the table then ;)
 
Back
Top Bottom