2024. április 16., kedd

Gyorskeresés

Howto: Backup and restore your Linux system

Írta: |

[ ÚJ BEJEGYZÉS ]

1: Backing-up

To do this, become root with
sudo su
and go to the root of your filesystem
cd /
Now, below is the full command I would use to make a backup of my system:
tar cvpzf backup.tgz --exclude=/proc --exclude=/lost+found --exclude=/backup.tgz --exclude=/mnt --exclude=/sys /
'cvpfz' are the options we give to tar, like 'create archive' (obviously),
'preserve permissions'(to keep the same permissions on everything the same), and 'gzip' to keep the size down.
Next, the name the archive is going to get. backup.tgz in our example.
Next comes the root of the directory we want to backup. Since we want to backup everything; /

tar zcvf backup.tgz --one-file-system /
Mounted folders wont be part of the backup. Easier than previous method.

2: Restoring

tar xvpfz backup.tgz -C /
WARNING: this will overwrite every single file on your partition with the one in the archive!
Create the excluded folders
mkdir proc
mkdir lost+found
mkdir mnt
mkdir sys
etc...

Hozzászólások

(#1) lapa


lapa
veterán

annyi, hogy ha úgyis tarolsz, akkor érdemes lehet egyből begpg-zni is, hogy semmilyen érzékeny adat ki ne jöjjön.

tar cpf /dev/stdout --exclude=/proc --exclude=/lost+found
--exclude=/media --exclude=/mnt --exclude=/sys
--exclude=/home/juzer / | gpg -c -o /media/raid2/sys_$(date
+%Y%m%d-%H%M%S).tar.gpg

figyelem a gpg tömörít, nem a tar. kifelé egyből / könyvtárba csomizás:

gpg -d sys_20090918-192917.tar.gpg | tar xvpfz /dev/stdin -C /

További hozzászólások megtekintése...
Copyright © 2000-2024 PROHARDVER Informatikai Kft.