Archive Entire Site?

Discussion in 'Web Design & Coding' started by Techno Child, May 1, 2007.

  1. Techno Child

    Techno Child web{designer} Folding Team

    Messages:
    871
    Location:
    Myrtle Beach
    Hey guys.

    How could I archive my entire site directory? I do have access to the parent dir, so I could run a php script to archive the folder containing the site. The only problem is, when I put the folder name in place of the file to be zipped - it doesn't archive the contents of the folder. Would I have to list the contents of all folders and sub-folders to be able to archive the entire site?

    btw. this is all new to me, I have never used php to zip files before...so it may be one of those "common sense" things.

    -tc
     
  2. LordOfLA

    LordOfLA Godlike!

    Messages:
    7,027
    Location:
    Maidenhead, Berkshire, UK
    tar -cjvf /path/to/tarball /path/to/compress
     
  3. Techno Child

    Techno Child web{designer} Folding Team

    Messages:
    871
    Location:
    Myrtle Beach
    sorry... I should have been more specific.

    The server is remote, and I have no direct command line connection. The script must be entirely php using zlib. Any Ideas?

    -tc
     
  4. LordOfLA

    LordOfLA Godlike!

    Messages:
    7,027
    Location:
    Maidenhead, Berkshire, UK
    whats wrong with using exec to run tar?
     
    Techno Child likes this.
  5. Techno Child

    Techno Child web{designer} Folding Team

    Messages:
    871
    Location:
    Myrtle Beach
    Nothing I guess.. I just don't know where tar is located on the server, or even IF it is installed. This is actually for a friend, the site is hosted over at 1and1.

    -tc
     
  6. kcnychief

    kcnychief █▄█ ▀█▄ █ Political User Folding Team

    Messages:
    16,948
    Location:
    Massachusetts
    1and1 does backups of your sites 24x7 - one thing to be wary of is that with most packages they can only restore from as far back as 24-48 hours. I would contact them for specifics to be sure.
     
    Techno Child likes this.
  7. albybum

    albybum Penguin Rancher

    Messages:
    280
    Location:
    Elizabethton, TN
    1and1 supports SSH connections if you can get the info from your friend.

    Tar should be located at /bin/tar
     
    Techno Child likes this.
  8. Geffy

    Geffy Moderator Folding Team

    Messages:
    7,805
    Location:
    United Kingdom
    If you have PHP and PEAR then I think you can use the Archive/Tar module.
     
    Techno Child likes this.