Results 1 to 4 of 4

Thread: Scheduled backup on an automatically mounted ext2 partition

  1. #1
    Join Date
    Jan 2012
    Beans
    3

    Scheduled backup on an automatically mounted ext2 partition

    I am pretty new to Ubuntu, but recently I had to configure a Linux server. The disk is 120 GB and is in two partitions: 1 File system partition 60GB and another sda5 partition 60GB. This server is gonna be 12 km away from me and I would be able to administrate it only remotely. It has to automatically mount the sda5 drive and one time in 24 hours, to make a backup on the whole system (File system drive) on this sda5 partition. How could this be done?
    Thanks in advance!

  2. #2
    Join Date
    Mar 2008
    Location
    Indore, India
    Beans
    233
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Scheduled backup on an automatically mounted ext2 partition

    you can schedule to run any command using cron, you can run

    Code:
    crontab -e
    to add or edit cron jobs

  3. #3
    Join Date
    Jan 2007
    Beans
    6,542
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: Scheduled backup on an automatically mounted ext2 partition

    You can use rsync to create the backup, and cron or anacron to carry it out. Since the server is likely to be on 24/7 you could use cron, but I find anacron much simpler to use. Simply drop your backup script into /etc/cron.daily and it will be run every 24 hours.

    As for the script itself, rsync is a one-line command. You haven't been specific about your backup requirements though. I assume you intend to copy the whole of one partition to the other, replacing the data from the previous 24 hours? That's fine, but the obvious flaw is that your data is still sitting on the single drive. You'll need to back it up to another location to properly secure it.

  4. #4
    Join Date
    Apr 2011
    Location
    Maryland
    Beans
    1,461
    Distro
    Kubuntu 12.04 Precise Pangolin

    Re: Scheduled backup on an automatically mounted ext2 partition

    I would definitely concur that leaving the backups on the main drive is dangerous. Your backups will be useless if the drive fails.

    Another tool to look into is Rsnapshot. It uses rsync to make the backups and keeps several copies of it in rotation depending on how many you want. For example, if you wanted a daily backup, you might have 7 copies of the backed up data for each day (although you can keep much less if you wanted), and on day 8, backup #1 will be overwritten. It handles all of the heavy lifting for you and is really easy to configure.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •