Results 1 to 1 of 1

Thread: Redhead, finally finished backup script

  1. #1

    Redhead, finally finished backup script

    Redhead,
    I just figured that I would drop a line to let you know that I finally finished the script you were helping me with. I couldn't have done it without your help! I had a few issues with ssh commands and quotation marks, and I was really confused... In some examples, I would have to use " to get it to work, in others '. Take a look below for two examples that look similar but required different styles of quotes in order to work:

    ssh $BUSRVR "ls -lt $BUDEST/$BUSUBDIR/ >> $LOGLOCATION4/$BUSUBDIR.txt"

    vs.

    ssh $BUSRVR
    'if [ -d '$BUDEST3/$BUSUBDIR' ];
    then echo "Backup destination '$BUDEST3/$BUSUBDIR' already exists. Preparing to remove this incremental backup set...";
    mkdir /tmp/emptydir;
    echo "Removing old incremental backup set...";

    rsync --delete -a /tmp/emptydir/ '$BULOGIN@$BUSRVR:$BUDEST3/$BUSUBDIR/';

    rmdir /tmp/emptydir;
    if [ `ls -a '$BUDEST3/$BUSUBDIR' | wc -l` -gt "2" ];
    then echo "The removal of the incremental backup set did not succeed. Either check your permissions at the backup destination on the server or delete the old backup set manually, and rerun the backup script.";
    exit;
    else echo "Removal of the incremental backup set succeeded.";
    fi
    else echo "No conflicting incremental backup sets found on the server. Continuing with the backup...";
    fi'

    It took me a while to figure it out, and even then, I was only able to do it because I opened the script in Kate and basically changed the quotes until the syntax highlighting was correct. Yeah, I cheated, but after working on it for a while and getting nowhere, I just needed it done. I can't be without backups for such a long time. I guess I could have used my old basic backup scripts, but who knows where those are now...

    So, I never got the mail to an internet address to work, so I just used 'scp' to copy it over my LAN. Good enough, I suppose...

    I would put it up here, just for grins, but it is really messy. You can't expect complicated things from a new guy, but it works very well. I am pretty pleased. Now, I can learn other more-technical aspects and rewrite it again at a later date because I just can't leave well-enough alone...

    Anyways, thanks a lot for the help. It was greatly appreciated.
    Last edited by vwgtiturbo; 06-28-2006 at 02:56 PM.
    Asus A8V Deluxe Mobo
    AMD Athlon64 X2 4400 -939
    2GB Crucial DDR3200 Dual-Channel
    ATi AiW 9800 Pro 128DDR
    Audigy2 ZS
    Sony DRU-810 DVD+RW DL
    3 x Maxtor MaxLine SATA 160Gb 16Mb Cache
    1 x Maxtor MaxLine SATA 300Gb 16Mb Cache
    1 x Maxtor MaxLine SATA 120Gb 16Mb Cache

Similar Threads

  1. backup script
    By berto in forum Linux - General Topics
    Replies: 12
    Last Post: 12-29-2009, 05:17 PM
  2. Automatic MySQL Backup Script
    By peter in forum Tutorials
    Replies: 1
    Last Post: 09-22-2009, 09:13 AM
  3. Automatic MySQL Backup Script
    By canela in forum Programming
    Replies: 2
    Last Post: 12-20-2006, 04:59 AM
  4. MySQl backup script
    By girlygeek in forum Programming
    Replies: 5
    Last Post: 11-11-2006, 11:23 PM
  5. Rsync incremental backup script
    By vwgtiturbo in forum Programming
    Replies: 6
    Last Post: 06-07-2006, 08:19 PM

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
  •