onfarbo/script/sauvegarde/sauvegarde45.sh
2022-02-10 15:44:09 +01:00

15 lines
395 B
Bash
Executable File

#!/bin/bash
HOST=root@onfarbo45
DATEJ=$(date +%u)
DATES=$(date +%W)
semaineMod=$(("${DATES}" % 4))
ssh "${HOST}" "mysqldump -u ap45 -pAzerty1+ bdarbre | gzip" > /root/sauv/jour/bdarbre45-"${DATEJ}".sql.gz
ssh "${HOST}" "mysqldump -u ap45 -pAzerty1+ bdarbre | gzip" > /root/sauv/semaine/bdarbre45-"${semaineMod}".sql.gz
scp -r "${HOST}":/var/www/html/PHPProjects/ONF /root/sauv/php45
exit 0