archiving
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| archiving [2012/07/25 23:16] – paulsmith | archiving [2015/03/12 00:47] (current) – paulsmith | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Archiving ====== | ||
| + | |||
| + | ===== Unpack a archive ===== | ||
| + | < | ||
| + | gzip -cd filename.tar.gz | tar -xvf - | ||
| + | tar xvzf filename.tar.gz | ||
| + | tar xvzf filename.tgz | ||
| + | bzip2 -cd file.tar.bz2 | tar xvf - | ||
| + | tar xjvf filename.tar.bz2 | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Create a archive file ===== | ||
| + | tar -zcvf backup.tar.gz / | ||
| + | |||
| + | |||
| + | tar -cjvpf ../ | ||
| + | tar -cjvpf ../ | ||
| + | |||
| + | ===== patching ===== | ||
| + | < | ||
| + | |||
| + | </ | ||
| + | |||
| + | ===== rsync ===== | ||
| + | rsync --progress -avxzlD --stats -EH /var/www/ /mnt/cdrom/ | ||
| + | rsync -avlDx -EHp -e ssh root@203.27.127.xxx:/ | ||
| + | |||
| + | |||
| + | ===== cp ===== | ||
| + | cp -xvpav /mnt/src/* /mnt/dst/ | ||
| + | |||
| + | |||
| + | < | ||
| + | parts=" | ||
| + | for part in $parts | ||
| + | do | ||
| + | mount / | ||
| + | mount / | ||
| + | sleep 5 | ||
| + | |||
| + | cp -xvpav /mnt/src/* /mnt/dst/ | ||
| + | sync | ||
| + | sync | ||
| + | sleep 5 | ||
| + | |||
| + | umount /mnt/src | ||
| + | umount /mnt/dst | ||
| + | |||
| + | done | ||
| + | </ | ||
| + | |||
| + | ===== copy a partition ===== | ||
| + | dd if=/ | ||
| + | | ||
| + | | ||
| + | ===== Unrar a series ===== | ||
| + | < | ||
| + | list=$(ls -d -1 /thepath/*) | ||
| + | for line in $list; do thefile=" | ||
| + | </ | ||
