Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Simple Ubuntu Backup

    I'm trying to back up a few directires on an ubuntu box /stor and /etc ...

    I've seen stuff for rsync and rdiff ... but they all involve creating certs and keys ... and generally require a bit more than I need.

    I just want to do a SIMPLE backup of /stor /etc to /mnt/backup. It is using a cifs share so no ssh or certs or keys needed.

    What would I need to do to back this up daily?

  2. #2
    I wrote a script for performing incremental backups everyday and an entire backups on Mondays:

    # Mount Windows share to '/mnt' directory
    mount -t cifs -o username=<win-user>,password=<password> //host/share /mnt
    # Incremental backup
    INC=`date | grep "Mon"`    # Check if it's Monday
    if [ -z "$INC" ]; then    # If it isn't Monday, perform incremental backup
        tar --create --compress \
            --file=/mnt/backup.tar.gz \    # Location to save tar file to
            --listed-incremental=/var/log/snapshot.snar \    # Incremental snapshot        
             ~/example    # Directory to be backed up    
    else # If Monday, perform full backup
        tar czf /mnt/backup.tar.gz /stor /etc 
    # Now that files have been archived+compressed to server, unmount CIFS share
    umount /mnt
    You may need to edit it for your particular system environment. Of course you'll want to create a cron-job that executes this script daily. As the Linux user you want to execute the script, type "crontab -e" to edit your cron-jobs:

    00 4 * * * ~/    # Backup daily at 4:00am
    The above script should run everyday at 4:00am. It will mount your Windows share to the /mnt directory of your Linux system. It should check to see if it is Monday. If it isn't, it will perform a incremental backup, keeping track of new/old files using a snapshot file specified in the script. If it is Monday, it performs a full backup.

    If you need assistance with the script, let me know. Hopefully it fits what your looking for. If not, I'll be happy to help you find a more suitable alternative.

Posting Permissions

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