0

Hi there trying to back up my filesystem to an external hard drive saved as a zip. Most of the help on the net so far shows how to backup certain directories but I didn't see anywhere showing when someone wants to back up / everything. Less /proc with the -x switch.

I am trying to follow this example from https://www.howtogeek.com/135533/how-to-use-rsync-to-backup-your-data-on-linux/

zip /ZippedFiles/archive.zip /Directory1/ && rsync -av --delete /ZippedFiles/ /Directory2/

Here is what I got so far:

zip //OrcaComputers.zip / && rsync -avx --delete // /run/media/orca/DataCabinet

What I am telling the machine is to zip the filesystem, call it OrcaComputers.zip and transfer it to the Data Cabinet.

I keep getting:

zip error: Internal logic error (empty name without -j or -r)

What am I missing here? I feel like it's something related to be using the /

1
  • zip is highly dangerous, since it carries a central reference at the end of the archive and completely fails to extract anything if that is missing or damaged. – schily May 12 '20 at 8:04
2

Whilst generally you're on the right track, you're still a little bit off from a successful backup. There's a few issues with it.

Firstly on a Linux file system, there are portions you don't want to backup, as they are representations of things that are not stored data. Namely /sys, /proc and /dev. So these need to be excluded from your backup (you mentioned /proc only).

Secondly, you're backing up information that could have changed between the moment you started until the moment the process finishes. So the end result might not be consistent. This is why, usually, whole file system backups are not taken, at least not from within the file system (typical alternatives are storage snapshots or backups from suspended VMs where the target is actually a VM).

Thirdly your suggested command line, if it is not a simplification of what you actually intend, is quite odd. Your double forward-slashes are seen as / and rsync will then try to move the entire filesystem again...

Finally, zip is really not a well suited tool directly packaging a file systems (or even portions of it...), there could be information lost, namely some metadata around hard or soft links, ownership and permissions, etc. In *nix land it's more effective to package then compress, typically with tar for archiving and gzip for compressing. tar is quite ready to do the compression step for you.

There are a lot of methodologies used by admins to perform backups, almost always handling system and data separately. There's good processes and programs that do the heavy lifting for you (99% of the effort). One of my personal favourites is restic.

Here's another suggestion (from Easy incremental backups to an external hard drive): rsnapshot

0

I installed restic,

On CentOS I ran:

yum install yum-plugin-copr yum copr enable copart/restic yum install restic

created the new repository| [restic -r /run/media/orca/Datacabinet init] Start repository [restic -r /tmp/restic-repo init]

Then make backup. restic -r /run/media/orca/Datacabinet backup ~

Time goes by, backup is complete. Yay! Only after seven years of procrastination and losing 120,000,000 customer records we have backups! And then there was peace all throughout the land.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.