backup of files and directories under LINUX and MACOS
Linux shell script to run at the command line $ sh my_script_backup.linux
Categories
Keywords
export D=$(date +%y-%m-%d)
echo $D" save_my_work.linux" >> /var/log/SAVE_MY_WORK
export AGO=$(date -d '6 days ago' +%yyyy-%m-%d)
mkdir -p /media/gbobard/SEDUSB/BACKUP/2023
echo -e "backup d une base de données supprimer le dièse du dessous"
# mysqldump -umoncompte -pmonpass nomdemabase > /media/gbobard/SEDUSB/BACKUP/2023/sql_monbackup-$D.sql
echo -e "backup du répertoire concerne"
tar cpzf /media/gbobard/SEDUSB/BACKUP/2023/www_$D.tar.xz /var/www/html
echo -e "efface le backup j-7"
# rm /media/gbobard/SEDUSB/BACKUP/2023/sql_monbackup-$AGO.sql
echo sql_monbackup-$AGO.sql
# rm /media/gbobard/SEDUSB/BACKUP/2023/www$AGO.tar.xz
echo Documents_$AGO.tar.gz