Help with compression.

Discussion in 'Site & Server Administration' started by lordmenace, Aug 26, 2006.

  1. #1
    I have a large amount of files on my webhost. Is there anyway that I canrun a script, that will take all teh contents of my webserver and compress them into a .zip, .sql.gz .anything so loing as it's compressed? It makes backing up files much easier.
     
    lordmenace, Aug 26, 2006 IP
  2. hans

    hans Well-Known Member

    Messages:
    2,923
    Likes Received:
    126
    Best Answers:
    1
    Trophy Points:
    173
    #2
    Linux / free BSD server ?
    I assume so with .sql
    hence:


    to compress a folder
    tar -czpv your_folder_to_compress > compressed_foldername.tar.gz

    and to uncompress again

    tar xzvpf compressed_foldername.tar.gz

    explanation of options used in an example:
    tar xzvpf file.tar.gz
    x = extract
    z = gzip / j = bz2
    v = verbose (zeigt die files beim auspacken an)
    p = preserve permission - needed for back up !!
    f file_to_uncompress.tar.gz

    tar xzvpf familyforum.tar.gz


    your mysql db
    IF you do manual backup via SSH
    pipe your back up command into bz2 compression tool
    this is done like below example

    mysqldump --add-drop-table -h your-db.host -u your-db-username -p database-name | bzip2 -c > /path-on-your-server/to-your-backups/database-name.bakup.sql.bz2
     
    hans, Aug 26, 2006 IP
  3. lordmenace

    lordmenace Well-Known Member

    Messages:
    541
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    140
    #3
    Yes, I am on a linux server, but where would I type those commands. This is a non-cpanel host. Is there a script for this?
     
    lordmenace, Aug 26, 2006 IP
  4. hans

    hans Well-Known Member

    Messages:
    2,923
    Likes Received:
    126
    Best Answers:
    1
    Trophy Points:
    173
    #4
    I am never using cpanel myself for important work only SSH access.
    use either telnet or better SSH to connect to your site
    then type in those commands in the remote shell of your site

    how few GB does your host offer you taht you have to worry aobut space ??
     
    hans, Aug 26, 2006 IP
  5. lordmenace

    lordmenace Well-Known Member

    Messages:
    541
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    140
    #5
    I dont beleive I have SSH acces either. I have a good amount of space, but I have a site that I want to download the ccontents of everyday just like I do with my mysql database. I just need a script that will compress all teh files into one so I can then download it.
     
    lordmenace, Sep 1, 2006 IP
  6. hans

    hans Well-Known Member

    Messages:
    2,923
    Likes Received:
    126
    Best Answers:
    1
    Trophy Points:
    173
    #6
    1.
    do you belief or do you KNOW to have NO ssh access ?
    and if no ssh
    what about telnet access ??

    and
    2.
    if you want every days content
    you may be better doig an rsync
    see
    man rsync
    on your linux laptop/desktop

    and rsync synchonizes / downloads only those online files that have changed since last update. that's the procedure i have with my 5 forums almost daily

    3.
    top do such professinal things you need an account with either SSH or telnet access - sooner or later - hence you either get it form your current host or you may change host to get what you need and want for an efficient professional site management. i could never in my life run my site without SSH access and I have selected hosts with such features in mind.
     
    hans, Sep 1, 2006 IP