homepage Welcome to WebmasterWorld Guest from 54.161.247.22
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / WebmasterWorld / Webmaster General
Forum Library, Charter, Moderators: phranque

Webmaster General Forum

    
Script or unity to unzip compressed files on remote server
Yangtze




msg:373991
 5:21 pm on Dec 30, 2005 (gmt 0)

It would be faster to upload a compressed files to remote server. Is there any script or unity available to unzip compressed files on remote server? I use WS_FTP. My hosting company's control panel does not provide this option. It is a Linux/Unix shared hosting.

 

Frank_Rizzo




msg:373992
 9:41 pm on Dec 30, 2005 (gmt 0)

If you have shell access or can create cron jobs then you can run

unzip or gunzip depending what is installed.

I regularily upload zip files and use a cronjob to check for the existance of a file and unzip it.


#######################
#
# unzip_uploads

cd /home/myuploads
if test -f ZIP_UPLOADED_FLAG
then
rm ZIP_UPLOADED_FLAG
if test -f ZIPPEDFILE.ZIP
then
unzip -o ZIPPEDFILE.ZIP -d /home/myuploads
cp ZIPPEDFILE.ZIP old/`date +%d%m%y`.zip
fi
fi

cronjob is set to run that file every 10 minutes.

First it checks for the existence of a ZIP_UPLOADED_FLAG file. This is just a dummy file and is FTP'd after the zip file. The reason for doing this is so that the script will only run after the zip file has been uploaded 100%.

Next, if the zipfile exists it is unzipped and overwrites existing files.

Lastly the zip file is copied to an archive dir and the name changed to the datestamp.

Yangtze




msg:373993
 6:11 am on Dec 31, 2005 (gmt 0)

Hi Frank_Rizzo,

Sorry, my hosting company does not support shell access.

kwngian




msg:373994
 7:31 am on Dec 31, 2005 (gmt 0)


Use the File Manager in Cpanel and the extract your zip files from there.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / Webmaster General
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved