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

15 lines
394 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/PHPProjects/ONF /root/sauv/php43
exit 0