Difference between revisions of "Ftp backup"

From Atomicorp Wiki
Jump to: navigation, search
(Script on ServerA)
 
(One intermediate revision by one user not shown)
Line 15: Line 15:
 
On Fedora Core :
 
On Fedora Core :
  
yum install lftp
+
yum install lftp
  
 
On Debian :
 
On Debian :
  
aptitude install lftp
+
aptitude install lftp
  
 
==Script on ServerA==
 
==Script on ServerA==
  
 
Create this script :
 
Create this script :
 +
 +
vi /path/to/your/script
  
 
  #!/bin/sh
 
  #!/bin/sh
Line 44: Line 46:
 
  EOF
 
  EOF
  
chmod +x /path/to/your/script
+
chmod +x /path/to/your/script
 +
 
 +
crontab -e
  
crontab -e
 
 
  15    23    *    *    *    /path/to/your/script
 
  15    23    *    *    *    /path/to/your/script
  

Latest revision as of 06:54, 16 July 2007

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)

Personal tools