Maak een backup van je Ubuntu systeem

Onderstaande is maar een stukje.

To start:

sudo su

and go to the root of your file system (we use this in our example, but you can go anywhere you want your backup to end up, including remote or removable drives.)

cd /

Now, below is the full command I would use to make a backup of my system:

tar -cvzf /backup.tgz --exclude=/proc --exclude=/lost+found --exclude=/backup.tgz --exclude=/mnt --exclude=/sys /

Now, lets explain this a little bit:

  • ‘tar’ is the program used to do a backup
  • c – create a new backup archive
  • v – verbose mode, tar will print what it’s doing to the screen
  • z – compress the backup file with ‘gzip’ to make it smaller
  • f <filename> – specifies where to store the backup, /backup.tgz is the file used in this example
  • Now come the directories we want to exclude. We don’t want to backup everything since some dirs aren’t very useful to include. Also make sure you don’t include the file itself, or else you’ll get weird results. You might also not want to include the /mnt folder if you have other partitions mounted there or you’ll end up backing those up too. Also make sure you don’t have anything mounted in /media (i.e. don’t have any cd’s or removable media mounted). Either that or exclude /media.
  • After all of the options is the directory we want to backup. Since we want to backup everything we use / for the root directory

If you want to exclude all other file systems you can use the –one-file-system option in addition to or instead of –exclude. With the –one-file-system option, only the “local” file system is backed up, that is, only the file system which you specify and not the file systems mounted under it in the file hierarchy. Use “df” to see which file systems you have mounted. The above command would thus be:

tar -cvzf /backup.tgz --one-file-system --exclude=/lost+found --exclude=/backup.tgz /
Geplaatst in Linux, Ubuntu

Geef een reactie

Gelieve met een van deze methodes in te loggen om je reactie te plaatsen: logo

Je reageert onder je account. Log uit /  Bijwerken )

Google photo

Je reageert onder je Google account. Log uit /  Bijwerken )


Je reageert onder je Twitter account. Log uit /  Bijwerken )

Facebook foto

Je reageert onder je Facebook account. Log uit /  Bijwerken )

Verbinden met %s

%d bloggers liken dit: