Find the answer to your Linux question:
Results 1 to 4 of 4
Hi, I'm an Ubuntu newbie and i need help with some task. I have a server and i'like to backup it daily. So i need some script, which do this ...
  1. #1
    Just Joined!
    Join Date
    Jul 2011
    Posts
    2

    newbie - cron help

    Hi,
    I'm an Ubuntu newbie and i need help with some task.


    I have a server and i'like to backup it daily. So i need some script, which do this task.

    - daily at 00:00 connect to SSH
    - download folders /www1 and /www4 from server and save them to disk (~/backup_YY-MM-DD) (and create todays folder, like backup_11-07-10) (through scp?)
    - after all is backuped, shutdown PC


    I'd like to study it myself, but i need backup server content quickly..


    Thx for help, better script with short explain.
    Last edited by panther89; 07-10-2011 at 10:19 AM.

  2. #2
    Linux Newbie hans51's Avatar
    Join Date
    May 2011
    Location
    Philippines and Cambodia
    Posts
    133
    for any/all backups and uploads it is easy and best to use

    rsync

    write a simple bash script (test the commands manually in CLI first, then enter in your bash script)
    using rsync commands to get all your folders backup'd
    after ever backup add at the end of line a
    ; sync
    to make sure all previous processes are finished and written to disk before proceeding (specially before shutdown)

    all rsync by default is SSH
    so I assume you have your server key authentication prepared to avoid any password need when doing cron jobs

    after you have done above backup one by one manually and successfully
    you then enter the path to your bash script in your cron entry

    I do my own server backups that way since years - also the opposite . to synchronize my servers with all offline prepared new content

  3. #3
    Just Joined!
    Join Date
    Jul 2011
    Posts
    2
    hans51
    Could you, please, write it more simply? I wrote i'm newbie, I've had Ubuntu for 3days now...

    I don't know, how to write "simple bash script"..

    Would you be please so kind and write it for me?



    I have no time to study it now, but I need create a server backup... I'll study it at the end of next week, but it's so late...

    Thx.

  4. #4
    Linux Newbie hans51's Avatar
    Join Date
    May 2011
    Location
    Philippines and Cambodia
    Posts
    133
    try to study this one
    Secure your data - howto backup your site or important online / offline data folders - how to make a full back-up from your site and what to consider - how to use rsync on SuSE Linux 10.1
    I have no time to explain in more detail and since you have no time to study yourself, it appears to be of no real importance to you
    later when back up important, you will have time to study rsync - its easy and

    man rsync

    may give you details on rsync options

    see also
    Back up like an expert with rsync | Linux.com
    ro Google for
    howto backup using rsync

Posting Permissions

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