Welcome to WebmasterWorld Guest from 54.145.118.24

Forum Moderators: phranque

Message Too Old, No Replies

Script or unity to unzip compressed files on remote server

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

Junior Member

10+ Year Member

joined:Sept 12, 2003
posts:116
votes: 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.
9:41 pm on Dec 30, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 17, 2002
posts:1187
votes: 6


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.

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

Junior Member

10+ Year Member

joined:Sept 12, 2003
posts:116
votes: 0


Hi Frank_Rizzo,

Sorry, my hosting company does not support shell access.

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

Preferred Member

10+ Year Member

joined:Jan 9, 2003
posts:359
votes: 0



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

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members