Backup Website using Wget Program

Your website is the visual aspect of your organization. To prevent loss of data and content of your website due to a fatal disaster; you can backup your website on timely basis. Nowadays Web Systems allow you to create your entire web back up from the website itself. There is easy and automatic way to back up your website files using the open source application called Wget.

To download Wget click here:

  1. You need to create a folder on your disk so that you can save your Wget and back up files. Preferred location would be C:/WebsiteBackup.
  2. After creating your backup folder, open your Zip file
  3. Now extract the content from the zip folder to C:/WebsiteBackup.

Create Backup using Batch-script

1) Open notepad, Copy the below lines to the notepad:

@echo off
wget --output-file=mylogfile.log –tries=2 –passive-ftp –mirror –ftp-user=UserID –ftp-password=pwd

Make sure the batch file should be only of two lines. The Wget line should be in one line and not two lines, if so make the ‘Wget line’ in single line.

2) Now store this file in C:/WebsiteBackup as WebBackup.bat.

3) Now you have to make some changes into Batch Script:

Select the following components of the Wget line and modify it as per the settings described below.

–output-file=mylogfile.log- mylogfile.log file will be automatically created into C:/WebBackup (Refer the figure 1)

Figure 1

tries=2, this specify number of attempts of retry to get the backup of your website. If you use 0, Wget will try to copy the file without letting up until it gets the file.

–ftp-user=userID Will be your ftp account username

–ftp-password=pwd, Will beyour ftp account password. You can get the username and password from your hosting service provider., is your ftp site which you want to back up.

After making changes save the file and don’t forget to close the notepad.

4) Once you are finished doing the backup script, you can now run the backup script, you have to double click on your .bat file. Empty black windows will pop-up. (Refer the figure 2) This black window will remain open till the completion of your backup process. The heading on the black window will exhibit your back up status and progress. After the completion of back up process the window will close automatically.

Figure 2

Now you can find these files copied to your computer from your website. This is a simple procedure to create a backup of your website.