Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 20
How can automatically backup certain directories and store the backups over the network via ftp? How can I make it secure so that each of the backups are passworded and ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2003
    Posts
    24

    AutoBackup over Network


    How can automatically backup certain directories and store the backups over the network via ftp? How can I make it secure so that each of the backups are passworded and whatnot... What do I need to backup? I was thinking I should backup:

    /home/
    /var/www/
    /etc/

    because of userfiles, web documents, and configuration files respectively. Would this be the right way to set up my backup? How could I do this, run a cron job that does this:

    tar directories
    ftp the directories to the server

    I don't know...I have kinda sorta an idea of what I want to do, but not really. Also, where are the mySQL databases kept?

  2. #2
    Linux Engineer
    Join Date
    Jan 2003
    Location
    Lebanon, pa
    Posts
    994
    You can write a script which will tar everything up and then ftp to another box. If the other box is running linux, check out using scp, rdump, or one of the many backup scripts which support remote hosts. For mysql, there is a program called mysqldump which you can use to backup your databases.

  3. #3
    Linux Engineer
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    796
    Write a program over SSH or use Rsync to sync specific directorys over the network or localy.

    regards

    Regards

    Andutt

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Engineer
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    796
    Write a program over SSH or use Rsync to sync specific directorys over the network or localy.

    regards

    Regards

    Andutt

  6. #5
    Linux Engineer
    Join Date
    Jan 2003
    Location
    Lebanon, pa
    Posts
    994
    No need to write a program to use ssh since there is scp.

  7. #6
    Linux Engineer
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    796
    But if you should relay on your backups its good with a little more errorhandling and checking then just scp everything and hopes everything is included and will work on a restore...but maybe thats me...
    Regards

    Andutt

  8. #7
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Yeah, that's just you. If you run this through cron, it will mail all errors to you. I would of course write a small shell script to do it, though. Especially since you can make it check scp for an erroneous exit status.

    By the way, what's status called in plural? Statii?

  9. #8
    Just Joined!
    Join Date
    May 2003
    Posts
    24
    Alright, I haven't done this yet but this is what I think I shall do.

    I'll write a quickie shell script that does this:

    1. Tar the directories that I want to be tarred.
    2. Run the mysql dump command to create a dump file.
    3. Tar that up.
    4. FTP all the tars over the LAN to the backup computer.
    5. Delete the tars.

    This will be run by a cron job at the top of each hour. Is there anyway that I can just keep the tars on the harddrive and just backup what has been changed? Would it be a good idea not to tar and just copy some directories? Are my permissions gonna be killed when I try to restore a backup?

  10. #9
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    tar keeps permissions, times and users. Just remember to zip the tar files.
    GNU tar seems to support incremental backups. Check out the -g option to tar.
    Don't use FTP, though. Use scp instead. Not only is it easier, but if you configure public key authentication for SSH, you won't even have to bother with passwords for it.

  11. #10
    Linux Engineer
    Join Date
    Jan 2003
    Location
    Lebanon, pa
    Posts
    994
    What are you trying to get at? Scp uses ssh for data transfers. As long as you are using tcp, you should feel relatively safe that your data will get to its destination. I haven't looked at the ssh source but I don't see how that would offer higher data integrity then other apps to transfer data unless it verifies md5 sums of files after it transfers them. But again, I haven't look through the source so I don't know.

Page 1 of 2 1 2 LastLast

Posting Permissions

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