tar cvf test.tar /tmp/test/
tar cvfz test.tar.gz /tmp/test/
#!/bin/sh - echo "`lsb_release -d -s`" >$LOG_FILE echo "`date '+%Y-%m-%d %H:%M:%S'` -> Backup $BACKUP_NAME started !" >>$LOG_FILE /bin/tar cvfX $BACKUP_FILE $EXCLUDE_LIST_FILE --files-from $BACKUP_FILES >>$LOG_FILE echo "`date '+%Y-%m-%d %H:%M:%S'` <- Backup $BACKUP_NAME finished !" >>$LOG_FILE /bin/gzip -f $LOG_FILE /bin/gzip -f $BACKUP_FILE
!/bin/sh - #FILE_TIME_STAMP=`date '+%Y-%m-%d_%H:%M:%S'`# Дата, время #FILE_TIME_STAMP=`date '+%d'` #День месяца FILE_TIME_STAMP=`date '+%u'` #День недели BACKUP_FILE_EXT=".tar" BACKUP_PATH="/mnt/Backup" LOG_PATH="/mnt/Backup" LOG_FILE_EXT=".log" NAME_TIME_SEPARATOR="." BACKUP_NAME_SUFFUX="_gate" export BACKUP_FILES="/usr/local/bin/Backup_1.files" export EXCLUDE_LIST_FILE="/usr/local/bin/Backup_1.exclude" export BACKUP_NAME="`hostname`$BACKUP_NAME_SUFFUX" export LOG_FILE=$LOG_PATH/$BACKUP_NAME$NAME_TIME_SEPARATOR$FILE_TIME_STAMP$LOG_FILE_EXT export BACKUP_FILE=$BACKUP_PATH/$BACKUP_NAME$NAME_TIME_SEPARATOR$FILE_TIME_STAMP$BACKUP_FILE_EXT # Команды перед копированием # Выполнение копирования /usr/local/bin/backup2tar.sh # Команды после копирования
var/named/chroot/proc var/named/chroot/var/run/dbus var/run var/agentx/master
/root/Config/ /root/Scripts/ /root/.config/mc /etc/network/interfaces /etc/network/if-pre-up.d/iptables /etc/proftpd/ /etc/ssh/sshd_config /etc/amavis/ /etc/apcupsd/ /etc/bind/ /etc/clamav/ /etc/default/
Распаковка ARCHIVE.tar.gz
gzip -d ARCHIVE.tar.gz
Распаковка ARCHIVE.tar
tar xvf ARCHIVE.tar
Распаковка ARCHIVE.tar.gz
tar -xvf ARCHIVE.tar.gz
gzip -k -c file.ext > /tmp/file.ext.gz
gzip -k -d file.ext.gz
Создание файла tar.gz
tar -czf archive-name.tar.gz file-name