备份脚本
时间:2007-11-14 来源:blueantelope
#!/bin/bash
#----------------------------
#--- blueantelope
#--- blueantelope@
#--- backup.sh
#--- backup for your system
#--- 0.01
#--- 2007-11-14
#----------------------------
#
GetDate=`date +%Y_%m_%d`
SetDir='/backup'
timeout=5
ExeShell='tar -czf'
# Check backup diretory else to create it
if [ ! -d $SetDir ]; then
mkdir $SetDir
chmod 700 $SetDir
chown root $SetDir
fi
# Backup for /etc/
$ExeShell $SetDir/etc$GetDate.tar.gz /etc/*
# Backup for /var/log
$ExeShell $SetDir/log$GetDate.tar.gz /var/log/*
chmod 700 $SetDir/*
sleep $timeout
#----------------------------
#--- blueantelope
#--- blueantelope@
#--- backup.sh
#--- backup for your system
#--- 0.01
#--- 2007-11-14
#----------------------------
#
GetDate=`date +%Y_%m_%d`
SetDir='/backup'
timeout=5
ExeShell='tar -czf'
# Check backup diretory else to create it
if [ ! -d $SetDir ]; then
mkdir $SetDir
chmod 700 $SetDir
chown root $SetDir
fi
# Backup for /etc/
$ExeShell $SetDir/etc$GetDate.tar.gz /etc/*
# Backup for /var/log
$ExeShell $SetDir/log$GetDate.tar.gz /var/log/*
chmod 700 $SetDir/*
sleep $timeout
相关阅读 更多 +