Find the answer to your Linux question:
Results 1 to 3 of 3
Hello, I have a problem - I attended a UNIX course a couple of years back but, unfortunately, I don't remember how to write scripts for shell commands. Now I ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2012
    Posts
    1

    Unix script to create a backup on a remote computer


    Hello, I have a problem - I attended a UNIX course a couple of years back but, unfortunately, I don't remember how to write scripts for shell commands. Now I want to make a script that makes a backup of a folder on a remote computer and I have no idea how to begin.

    So the idea is that I want the script to create a series of archives of a target directory, each archive must be no larger than 2GB in size and files should be each put in only one archive (as opposed to half of the file in archive1 and the other half in archive2), do not worry there are no files bigger than 2GB . For the transfer along the net I remember something about "ssh" and generated keys - to avoid password requst every time.

    I also want the script to create a text file which indicates which file is in which archive or which archive contains which files, whichever.


    Thank you!

  2. #2
    Just Joined!
    Join Date
    Nov 2008
    Posts
    34
    tar -cvzf <ARCHIVE_NAME> <FILES_TOBE_INCLUDED>

    you can use the following Append option

    tar -avzf

    But the tar does not check for the size of the file , So we have programmatically check for the size of the archive before and after adding for 2G size
    If its negative , revert it back

    We can list the files in the archive using the Tar command

    let me know if this algorithm works

    Philix

  3. #3
    Just Joined!
    Join Date
    May 2011
    Location
    Malaysia
    Posts
    15
    You can consider using AMANDA backup to perform full dump backups and incremental backups.

    Google 'amanda tutorial' for a step-by-step tutorial.



    Quote Originally Posted by Azula View Post
    Hello, I have a problem - I attended a UNIX course a couple of years back but, unfortunately, I don't remember how to write scripts for shell commands. Now I want to make a script that makes a backup of a folder on a remote computer and I have no idea how to begin.

    So the idea is that I want the script to create a series of archives of a target directory, each archive must be no larger than 2GB in size and files should be each put in only one archive (as opposed to half of the file in archive1 and the other half in archive2), do not worry there are no files bigger than 2GB . For the transfer along the net I remember something about "ssh" and generated keys - to avoid password requst every time.

    I also want the script to create a text file which indicates which file is in which archive or which archive contains which files, whichever.


    Thank you!

Posting Permissions

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