Code: Select all
sudo tar --exclude=/media/* --exclude=/proc --exclude=/dev --exclude=/tmp --exclude=/run cvzf /media/pi/USB120DRV/pibackup.tar.gz /Code: Select all
sudo tar --exclude=/media/* --exclude=/proc --exclude=/dev --exclude=/tmp --exclude=/run -cvzf /media/pi/USB120DRV/pibackup.tar.gz /Yes, …/pibackup.tar.gz is the name of the archive you are creating. It is the argument to the "-f" part of the preceding "-cvzf" option. Everything that is not an option or an argument to an option, is a file or directory to back up. So "/" means to backup everything, except the directories you already excluded.davenull wrote:and the blank space at the end is correct between
../pibackup.tar.gz and /
Code: Select all
sudo tar -cvzf /media/pi/USB120DRV/pibackup.tar.gz --one-file-system / /bootCode: Select all
sudo tar --exclude=/media/* --exclude=/proc --exclude=/sys --exclude=/dev --exclude=/tmp --exclude=/run -cvzf /media/pi/USB120DRV/pibackup.tar.gz /This was why having an image of the boot and os while keeping the data on a different drive/partition makes sense.grumpy_dad wrote:I doubt rsync can restore in case of an SD card corruption, in which case you'll need to wipe everything and reinstall. I simply make SD card clones every month and save 3 most recent clones, it's much easier to restore as well (at least for me!). I just have an 8gb sd card.
so how to proceed then in case of need to restore the files from the *.tar.gz ?asandfort (edited) wrote:If you really want a one liner:Code: Select all
sudo tar --exclude=/media/* --exclude=/proc --exclude=/dev --exclude=/tmp --exclude=/run -cvzf /media/pi/USB120DRV/pibackup.tar.gz /
davenull wrote: In case files and folders of the the SD card got damaged, deleted, or corrupted:
by which command can I restore everything from the pibackup.tar.gz file?
At the worst case:
if I had to make a complete new installation by NOOBS (the first basic installation),
and now want to update to my latest backup state?
( I now have the pibackup.tar.gz file (1.5 GB) in the root dir of my USB drive ( USB120DRV ).
google "extract a gzipped tarball"davenull wrote:
so how to proceed then in case of need to restore the files from the *.tar.gz ?
Code: Select all
unzip -xvzf /media/pi/USB120DRV/Akten/ pibackup.tar.gz /Code: Select all
tar xavf /media/pi/USB120DRV/Akten/pibackup.tar.gzTry this thendavenull wrote:the man is too cryptic and too technical English, too hard to understand for my poor English skills.
So I open the LX Terminal (even better: the File Manager),
move to the USB folder,
and start the restore program out of that folder.
Code: Select all
tar xavf /media/pi/USB120DRV/Akten/pibackup.tar.gz
Is this the functionality which is provided and which is needed?
Does this tar command know then to which path and to which folders it has to write all and everything?
Is this the functionality which is provided and which is needed?So I open the LX Terminal (even better: the File Manager),
move to the USB folder,
and start the restore program out of that folder by this command:
Code: Select all
tar -xavf /media/pi/USB120DRV/Akten/pibackup.tar.gz
to restore though.Alle Dateien aus archive.tar extrahieren.
tar -xf archive.tar
Code: Select all
tar -xf /media/pi/USB120DRV/Akten/pibackup.tar.gz