Ftp backup
From Atomicorp Wiki
Contents |
[edit] How-to backup my plesk ?
[edit] Before you start
You need your primary server (wich had Plesk installed and running). We call it "ServerA".
You need a second server, where you send your backup file. We call it "ServerB".
I think it's a good idea to use an encrypted connection, like TLS, between your two server. ServerB need a ftp deamon wich support TLS.
Create "/var/backup/" directory on ServerA and ServerB.
Install "lftp" on ServerA.
On Fedora Core :
yum install lftp
On Debian :
aptitude install lftp
[edit] Script on ServerA
Create this script :
vi /path/to/your/script
#!/bin/sh # # Format date YYYY-MM-DD-HH-MM # date=`/bin/date +%F-%R` # # Create plesk backup # /usr/local/psa/bin/pleskbackup all /var/backup/fullbackup-$date.bak # # Connect to FTP, change directory, send files, disconect. # lftp -u login,password ftp.serverb.com <<EOF cd / lcd /var/backup/ mirror -R quit 0 EOF
chmod +x /path/to/your/script
crontab -e
15 23 * * * /path/to/your/script
[edit] Verify on ServerB
tail -f /var/log/messages
[edit] Notes
This script send all files on /var/backup/
Need improvement.
--Nothing 06:52, 16 July 2007 (EDT)