Results 1 to 1 of 1

Thread: baSH website automation script help - Compress and archive

Threaded View

  1. #1
    Join Date
    Dec 2010
    Location
    Snohomish, Washington
    Beans
    19
    Distro
    Ubuntu

    Question baSH website automation script help - Compress and archive

    I am writing a website and I want to automate the process of compressing and archiving the current Release folder, moving it into the Legacy folder, then moving the contents of the Dev folder into Release. I don't understand tar and gzip very well so I would like some help with the compressing and archiving part.

    Here is what I have so far:
    Code:
    #!/bin/bash
    
    NOW=$(date +"%m-%d-%y")
    
    # Change to the Reviews directory
    cd /opt/lampp/htdocs/Reviews/
    
    # First compress the contents of the current Release folder called Release.mm-dd-yy
    
    # Compress and archive release folder here
    
    # Move the compressed archive to ./Legacy
    mv -r "./Release.$NOW.tar.gz" ./Legacy
    
    # Clear the folder for the new files
    cd Release
    rm -r *
    cd ../
    
    mv -r ./Dev/* ./Release
    
    echo "Completed successfully.\n"
    Last edited by sikuneh; January 30th, 2012 at 05:13 PM.

Tags for this Thread

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
  •