This repository has been archived on 2025-06-10. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
server/backup.sh

28 lines
545 B
Bash
Executable file

#!/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
mysqldump -u backup --password="Riuy6of sae^W0Sh" fic2014 > "$TO_BCKP"/db/`date +%Y%m%d-%H%M`.sql
rsync -avL misc "$TO_BCKP"
rsync -avL .git "$TO_BCKP"
rsync -avL logs "$TO_BCKP"
rsync -avL /var/log "$TO_BCKP"
rsync -avL true_files "$TO_BCKP"
else
echo No volume mount on $TO_BCKP
fi