How to create a cygwin script to automatic backup on local PC in ispconfig

75 Views Asked by At

My script is for backup web directory and SQL files of all the Website in ispconfig panel on my local machine (not on linux dedicated server). The script is cygwin bash.

1

There are 1 best solutions below

0
Ornot On
#!/bin/bash
now=$(date +"%Y-%m-%d" -d "0 day ago");
rsync -azvr -e 'sshpass -p "YOUR_PASSWORD" ssh -p YOUR_PORT_SSH_IF_NEEDED -o StrictHostKeyChecking=no' root@HOSTAME:"/var/backup/web*/*${now}*" /cygdrive/h/YOUR_SPECIAL_PATH_ON_LOCAL_MACHINE/var-backup-${now}

In fact, in ispconfig panel on linux server the backup files is in:

/var/backup/web-TODAY_DATE/

and I transfer all this files in

H:/YOUR_SPECIAL_PATH_ON_LOCAL_MACHINE/var-backup-${now}