직접 적용하고 있는 백업 스크립트입니다.
#!/bin/sh
filename=`date --iso-8601`
echo "##### $filename Backup start"
mkdir /home/backup/"$filename"
cd /home/backup/"$filename"
# /etc
echo "/etc Backup Processing..."
tar cvfz "$filename"_etc.tgz /etc
# /usr/local/etc
echo "/usr/local/etc Backup Processing..."
tar cvfz "$filename"_usr_local_etc.tgz /usr/local/etc
# /usr/local/src
echo "/usr/local/src Backup Processing..."
tar cvfz "$filename"_usr_local_src.tgz /usr/local/src
# /mysql DB Backup
echo "mySQL Backup..."
tar cvfz "$filename"_mysql_dir.tgz /home/dbdata
# /var/log backup
echo "LOG Backup..."
tar cvfz "$filename"_var_log.tgz /var/log
# change mode 700 all
echo "Change mode 700 *"
chmod 700 *
echo "##### Backup complete..."
:맥노턴.
#!/bin/sh
filename=`date --iso-8601`
echo "##### $filename Backup start"
mkdir /home/backup/"$filename"
cd /home/backup/"$filename"
# /etc
echo "/etc Backup Processing..."
tar cvfz "$filename"_etc.tgz /etc
# /usr/local/etc
echo "/usr/local/etc Backup Processing..."
tar cvfz "$filename"_usr_local_etc.tgz /usr/local/etc
# /usr/local/src
echo "/usr/local/src Backup Processing..."
tar cvfz "$filename"_usr_local_src.tgz /usr/local/src
# /mysql DB Backup
echo "mySQL Backup..."
tar cvfz "$filename"_mysql_dir.tgz /home/dbdata
# /var/log backup
echo "LOG Backup..."
tar cvfz "$filename"_var_log.tgz /var/log
# change mode 700 all
echo "Change mode 700 *"
chmod 700 *
echo "##### Backup complete..."
:맥노턴.