2014-01-21 02:42:01 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
cd `dirname "$0"`
|
|
|
|
TO_BCKP="/mnt/backup"
|
|
|
|
|
|
|
|
chown synchro "$TO_BCKP"
|
|
|
|
|
|
|
|
if [ "$UID" = "0" ]
|
|
|
|
then
|
|
|
|
SCRIPT=`pwd`/`basename "$0"`
|
|
|
|
su -c "sh $SCRIPT $@" synchro
|
|
|
|
exit $?
|
|
|
|
fi
|
|
|
|
|
|
|
|
if mount | grep "$TO_BCKP" > /dev/null
|
|
|
|
then
|
|
|
|
|
2014-01-21 02:56:17 +00:00
|
|
|
mysqldump -u backup --password="Riuy6of sae^W0Sh" fic2014 > "$TO_BCKP"/db/`date +%Y%m%d-%H%M`.sql
|
2014-01-21 02:42:01 +00:00
|
|
|
|
2014-01-21 02:56:17 +00:00
|
|
|
rsync -avL misc "$TO_BCKP"
|
2014-01-21 02:42:01 +00:00
|
|
|
rsync -avL .git "$TO_BCKP"
|
2014-01-21 02:56:17 +00:00
|
|
|
rsync -avL logs "$TO_BCKP"
|
|
|
|
rsync -avL /var/log "$TO_BCKP"
|
|
|
|
rsync -avL true_files "$TO_BCKP"
|
2014-01-21 02:42:01 +00:00
|
|
|
|
|
|
|
else
|
|
|
|
echo No volume mount on $TO_BCKP
|
|
|
|
fi
|