Pour éditer le wiki, il faut demander un compte à un Lapin !
Difference between revisions of "Routeur rabbit/backup"
From Le L∞p's Wiki
(Created page with "<pre> #!/bin/bash HOST="rabbit.caserne" LOGIN="===== HIDDEN LOGIN =====" PASS="===== HIDDEN PASSWORD =====" BACKUP_DIR="/home/backup" COOK="/tmp/cookies.txt" LOG="${BACKUP_D...") |
m (/etc/rc.create_full_backup) |
||
Line 16: | Line 16: | ||
gzip ${BACKUP_DIR}/*.xml | gzip ${BACKUP_DIR}/*.xml | ||
</pre> | </pre> | ||
+ | |||
+ | {{Voir aussi|{{fichier|/etc/rc.create_full_backup}} pour faire un [https://doc.pfsense.org/index.php/Full_Backup full backup]}} |
Revision as of 15:40, 2 November 2014
#!/bin/bash HOST="rabbit.caserne" LOGIN="===== HIDDEN LOGIN =====" PASS="===== HIDDEN PASSWORD =====" BACKUP_DIR="/home/backup" COOK="/tmp/cookies.txt" LOG="${BACKUP_DIR}/backup.log" echo "Backup of ${HOST} with login ${LOGIN} in ${BACKUP_DIR}" curl -k -b ${COOK} -c ${COOK} --data "login=${LOGIN}&usernamefld=${LOGIN}&passwordfld=${PASS}" https://${HOST} 2>&1 |tee -a ${LOG} curl -k -b ${COOK} -c ${COOK} --data "login=${LOGIN}&usernamefld=${LOGIN}&passwordfld=${PASS}" https://${HOST}/diag_backup.php 2>&1 |tee -a ${LOG} curl -k -b ${COOK} -o ${BACKUP_DIR}/config-router-`date +%Y%m%d%H%M%S`.xml --data 'Submit=download&donotbackuprrd=no' https://${HOST}/diag_backup.php 2>&1 |tee -a ${LOG} gzip ${BACKUP_DIR}/*.xml