Create timestamped website backups

Browse by products and services

  • Applies to: Grid
    • Difficulty: Medium
    • Time: 10 minutes
    • Tools needed:¬†SSH, Basic Command-Line Knowledge, VI or VIM


This article will walk you through how to create timestamped website back-up of your website on the Grid.

This article is provided as a courtesy. Installing, configuring, and troubleshooting third-party applications is outside the scope of support provided by (mt) Media Temple. Please take a moment to review the Statement of Support.


  1. Decide which domain you want to back up then go to that directory.

    cd domains/
  2. Use VI or VIM to create a new file named '':

  3. Add the following information into the file, replacing the placeholders with your domain, and then save:

    cd ~/domains/
    zip -r backup`date '+%Y-%m-%d'`.zip html/*
  4. Run a command which will make the file executable by you, the owner:

    chmod 744
  5. Just to make sure it works, test it out:

  6. You should see lines appearing on the screen as each file and folder is added to the archive. They will look something like this:

    adding: html/Media.php (deflated 24%)
    adding: html/Temple.txt (deflated 61%)
    adding: html/Totally.ico (deflated 44%)
    adding: html/Rocks.mp3 (deflated 68%)
    adding: html/Yay/Media/Temple.html (deflated 51%)
  • When you perform a list directory command (ls), you should see a file called "", or whatever is the corresponding date. So now that we have a working script, it's time to make a regularly occurring job out of it.
  • From inside the AccountCenter, choose the 'Admin' button and then click 'Cron Jobs'.
  • Click the 'Add new cron job' button.
  • Fill out the notification email field. This is important, so you are notified if the cron job fails.
  • Fill out the "Command or script to execute" field with the full path to your backup. In this example, it will be:

  • Choose what time you want the cron job to run. Since this will be a daily backup, you might want to specify 12:00am daily. Or perhaps you would rather back things up at 6:00pm, or at 8:45am; it is up to you.
  • Once you are satisfied, press the save button.
  • Resources