Quantcast
Channel: Robin Kemp's blog
Viewing all articles
Browse latest Browse all 3

Website backup script

$
0
0
The attached zip contains a very simple script that uses WinSCP , FI and 7-Zip to backup a website via FTP to the local machine.  It first downloads the entire site to the directory it was run from, 7-Zips it to the output directory, deletes the temporary copy and then checks the output directory for backups older than 30 days and deletes them.

To configure it for your own use you will need to edit the winscpscript.txt and change the following lines to your FTP details and the directory you want to back up if public_html isn't where your website is stored.

open ftp://username:password@ftp.sitename.com
get public_html/* website-backup\*'                 

The default output is C:\WebsiteBackup but if you need to change it you can edit the websitebackup.bat and change 'c:\WebsiteBackup' in the following lines:

7za a c:\WebsiteBackup\backup-%dtt%.7z website-backup
For /f "Tokens=*" %%f in ('fi /A-d /b /gw">"30 C:\WebsiteBackup\*.*') do del /q               
AttachmentSize
Package iconwebsitebackup.zip1.64 MB
Subjects: 

Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images