tar -cvpzf httpdocs.tar.gz /httpdocs
tar -cvpzf backup.tar.gz --exclude=/backup.tar.gz --exclude=/proc --exclude=/lost+found --exclude=/sys --exclude=/mnt --exclude=/media --exclude=/dev /
- tar - is the command that creates the archive. It is modified by each letter immediately following, each is explained bellow.
- c - create a new backup archive.
- v - verbose mode, tar will print what it's doing to the screen.
- p - preserves the permissions of the files put in the archive for restoration later.
- z - compress the backup file with 'gzip' to make it smaller.
- f <filename> - specifies where to store the backup, backup.tar.gz is the filename used in this example. It will be stored in the current working directory, the one you set when you used the cd command.
- --exclude=/example/path
- x - Tells tar to extract the file designated by the f option immediately after. In this case, the archive is /home/test/backup.tar.gz
- -C <directory> - This option tells tar to change to a specific directory before extracting. In this example, we are restoring to the root (/) directory.
Hiç yorum yok:
Yorum Gönder