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

16 lines
463 B
Bash
Executable File

#!/bin/bash
HOST=root@onfarbo43
DATEJ=$(date +%u)
DATES=$(date +%W)
semaineMod=$(("${DATES}" % 4))
ssh "${HOST}" "mysqldump -u ap43 -pAzerty1+ bdarbre | gzip" > /root/sauv/jour/bdarbre43-"${DATEJ}".sql.gz
ssh "${HOST}" "mysqldump -u ap43 -pAzerty1+ bdarbre | gzip" > /root/sauv/semaine/bdarbre43-"${semaineMod}".sql.gz
scp -r "${HOST}":/var/www/html/PHPProjectsAM/ /root/sauv/php43/AM
scp -r "${HOST}":/var/www/html/PHPProjectsAS/ /root/sauv/php43/AS
exit 0