#!/bin/bash
# backup files in /home direscory
BACKUPSOURCE=/home/*
BACKUPDEST=/root/tmp/.
BACKUPFILE=backupnew.`date +%F`.tar.gz
COUNT=`ls -A $BACKUPDEST/backup* | wc -l`
LIMIT=2
if [ $COUNT -le $LIMIT ]
then
tar -czvf $BACKUPDEST/$BACKUPFILE $BACKUPSOURCE
scp $BACKUPDEST/$BACKUPFILE 192.168.20.13:
fi
:wq
No comments:
Post a Comment