#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2001
    Location
    Rochester, NY
    Posts
    1
    Rep Power
    0

    Question Backup files with file permissions


    I develop my site in the Windoze world using M$ Frontpage and publish to a host with a UNIX server. Recently I've begun to incorporate a lot of PHP and PERL scripts into the site.

    I try to periodically backup my data on the server by downloading all the files and directories to my Windows PC using a FTP program called LeechFTP.

    The problem is that this doesn't backup or record any of the UNIX file permissions. I'm worried that it could take hours or days to get all my scripts working again if I had to restore them myself; or if I were to someday move the site to a new host. That's because I would probably have to reread all the original documentation for the scripts to find out what the file permissions should be.

    Is there a FTP program, utility, script or UNIX trick that I can use to back up my files along with their file permissions and store them on a Windows machine?

    Thanks,

    Rob
  2. #2
  3. Code Cruncher
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2001
    Location
    Tasmania, Australia
    Posts
    121
    Rep Power
    14
    Is there a FTP program, utility, script or UNIX trick that I can use to back up my files along with their file permissions and store them on a Windows machine?
    Well ... you might just be in luck there.

    Use the 'tar' command to compress all the files on the UNIX server into one file and then transfer this one file down to your Windog for backup. The single file that tar gives you (called a 'tar ball') preserves all the files with their permissions. Just un-tar it on the UNIX box again and ... wallah.

    Log into the UNIX machine to the command prompt.

    1. To backup go the the directory containing the files and
    tar cvpzf <tarball-filename.tgz> *
    (this also takes in all sub directories as well)

    2. To see what is inside the tarball
    tar tvzf <tarball-filename.tgz>

    3. To extract the tarball
    tar xvpzf <tarball-filename.tgz>

    I use linux , you probably should check these options do the same thing on your UNIX flavour. Type 'man tar' to see the list of options. (Manual for Linux GNU tar )
    Beware of a programmer with a screwdriver!

IMN logo majestic logo threadwatch logo seochat tools logo