Objective
In the backup, the main need to identify which directories do not need to back up, although there are many tutorials on the web, but also to adjust the parameters according to their own situation.
First, clean cache, Recycle Bin, etc.
# Clean up old software cache
sudo apt-get autoclean
# #
clean up all software caches
sudo apt-get #
# Remove orphaned software
that the system no longer uses sudo apt-get autoremove
Ii. use of the tar backup
1. Command and parameter explanation
V: Display detailed compression information
C: Create a tar Package
J: Use BZIP2 compression format
Z: Using gzip compression format
P: Use absolute path
F: Path to the compressed file generated
2. Terminal operation
# Switch to root identity
su-root
# #
Use the GZIP compression format (compressed slightly low but fast)
tar vzcpf/media/chris/linuxdata/backup/ubuntu_ ' Date +%y%m%d_%h '. tar.gz--exclude=/proc--exclude=/dev--exclude=/mnt--exclude=/media--exclude=/lost+found-- Exclude=/cdrom--exclude=/tmp--exclude=/sys--exclude=/home/chris/.cache--exclude=/run/>/media/chris/ Linuxdata/backup/ubuntu_ ' Date +%y%m%d_%h '. Log 2>/media/chris/linuxdata/backup/ubuntu_ ' date +%Y%m%d_%H '. Error
#
# Use BZIP2 compression format (compressed slightly higher, but slow)
tar vjcpf/media/chris/linuxdata/backup/ubuntu_ ' date +%y%m%d_%h '. tar.bz2- -exclude=/proc--exclude=/dev--exclude=/mnt--exclude=/media--exclude=/lost+found--exclude=/cdrom--exclude=/tmp- -exclude=/sys--exclude=/home/chris/.cache--exclude=/run/>/media/chris/linuxdata/backup/ubuntu_ ' Date +%Y%m%d_ %H '. Log 2>/media/chris/linuxdata/backup/ubuntu_ ' date +%y%m%d_%h '. Error
III. Recovery System
1, recommended backup under:/boot and/etc/fstab, and then execute the RESTORE command
2, copy the backup file to/directory, the implementation of the RESTORE command:
# Use the gzip format
su-root
tar vxzpf ubuntu*.tar.gz-c/
#
# Use BZIP2 format for
tar vxjpf ubuntu*.tar.bz2-c/
Summarize
The above is the entire content of this article, I hope the content of this article for everyone's study or work can help, if there is doubt you can message exchange.