Читать книгу Linux Bible - Christopher Negus - Страница 219

Backup script

Оглавление

Because nothing works forever and mistakes happen, backups are just a fact of life when dealing with computer data. This simple script backs up all of the data in the home directories of all of the users on your Fedora or RHEL system.

 #!/bin/bash # (@)/my_backup # A very simple backup script # # Change the TAPE device to match your system. # Check /var/log/messages to determine your tape device. TAPE=/dev/rft0 # Rewind the tape device $TAPE mt $TAPE rew # Get a list of home directories HOMES=`grep /home /etc/passwd | cut -f6 -d':'` # Back up the data in those directories tar cvf $TAPE $HOMES # Rewind and eject the tape. mt $TAPE rewoffl

Linux Bible

Подняться наверх