---
title: 'Site backup via script'
url: 'https://jeepmonkey.com/blog/site-backup-via-script'
markdown: 'https://jeepmonkey.com/blog/site-backup-via-script.md'
date: '2014-10-18'
description: 'I was required to backup a company website, this backup had to be able to be stood up on a plain jane webserver. So after a bit of googling I came up with this. The tarball can be unpacked into the docroot standing the site up as it was the date it was backed up. Not entirely pretty but done this w…'
taxonomy:
  category:
    - Computer
  tag:
    - Backup
    - bash
    - linux
    - script
    - website
    - wget
---

# Site backup via script

## [Site backup via script](https://jeepmonkey.com/blog/site-backup-via-script)

    18th Oct 2014   [Backup](https://jeepmonkey.com/tag:Backup#body-wrapper) [bash](https://jeepmonkey.com/tag:bash#body-wrapper) [linux](https://jeepmonkey.com/tag:linux#body-wrapper) [script](https://jeepmonkey.com/tag:script#body-wrapper) [website](https://jeepmonkey.com/tag:website#body-wrapper) [wget](https://jeepmonkey.com/tag:wget#body-wrapper)  

I was required to backup a company website, this backup had to be able to be stood up on a plain jane webserver. So after a bit of googling I came up with this. The tarball can be unpacked into the docroot standing the site up as it was the date it was backed up. Not entirely pretty but done this way to conform to govt record keeping requirements.

```
wget --mirror -p --convert-links -P ./$1 http://www.$1.com --no-check-certificate --quiet --no-host-directories
tar cfz $1Website$(date +%F).tar.gz $1
```

Of course there was more to this script ie. initialisations, notifications, ftping to network share, but the main part (the actual copy of the site) is listed above.

nb. for this example let $1 = jeepmonkey

 [ Previous Post](https://jeepmonkey.com/blog/scrape-transaction-count-from-esmac) [Next Post ](https://jeepmonkey.com/blog/reporting-on-micro-focus-see-hsf)

#### Popular Tags

---

## Navigation

- Parent: [Blog](https://jeepmonkey.com/index.md)
- Previous: [Reporting on Micro Focus SEE HSF](https://jeepmonkey.com/blog/reporting-on-micro-focus-see-hsf.md)
- Next: [Scrape Transaction Count from ESMAC](https://jeepmonkey.com/blog/scrape-transaction-count-from-esmac.md)
