Tutorials - PAYH Webhosting Platform (inc Preview) > Using CRON to unpack a tar.gz file
Generated by xpcomputers and first published HereIt is very easy when you know how, and here is a detailed, click by click, guide (it is quicker to do that it takes to read this!).
I recommend placing the tar.gz install file directly in the HTTPDOCS directory using an ftp client (outside scope of this document).
Note: Before you upload the file, you might want to clear httpdocs directory of all test files & directories not belonging to you that are there by default
* Logn to Plesk Control Panel
* In Plesk, at the bottom, click on USERNAME.PLUSHOST.CO.UK (or your listed domain if it is different from this).
* Click on CRONTAB icon
* Under SYSTEM USER, choose your main user.
* Click on SCHEDULE A TASK FOR . . . .
* I recommend you fill this form in from the bottom upwards. So firstly, in COMMAND box enter as one long line:
/bin/tar -zxvf httpdocs/your-install-file.tar.gz -C httpdocs/ > httpdocs/tar-gz-log 2>&1
You can copy and paste it, but don't forget to amend the name of your tar.gz file
If you need to amend anything else, here is what each bit means:-
/bin/tar -zxvf
= unpacking command (leave as is, unless you know you need a different command option)
httpdocs/your-install-file.tar.gz
= file location & name of your install file go here. Note this is relative to your home directory (eg username.plushost.co.uk) and has no leading "/"
-C httpdocs/
= -C to set creation location, followed by the location you want the file unpacking into (many install files will auto create their own sub-directory here anyway).
> httpdocs/tar-gz-log 2>&1
= the > redirects all screen comments (2>&1 includes errors & successes) to a logfile called "tar-gz-log" in the httpdocs directory
* Click SELECT THE DAY OF WEEK radio button, then choose today's day from the drop down list
* Click SELECT MONTH OF YEAR radio button, then choose month it is from drop down list.
* Enter today's date number in day of the month in box
* In the HOUR box, enter the hour you want the script to run (maybe in about 3 minutes time)
* In the MINUTE box, enter the minute you want script to run (maybe in about 3 minutes time)
* Click OK
* Wait until after your chosen time and then wait a few more minutes to give it time to run (good time to go for a cuppa!)
* At very top of the page click on USERNAME.PLUSHOST.CO.UK (or your domain if different)
* Click FILE MANAGER icon
* Click HTTPDOCS
* You should now see your unpacked files (or their parent directory at least) and also your tar-gz-log logfile
* Click the preview icon to the right of tar-gz-log (if the logfile isn't here, something has gone very wrong)
* Check the logfile contents for any errors (it should tell you it has succeeded in unpacking all the files)
* Once you are sure it worked, return to CRONTAB to delete the task, so it doesn't run again in a few years time!
(tick box to left of the task, the click REMOVE SELECTED)
* You can now carry on following the instructions that came with your install file
Enjoy
Original Article by: MauriceB - Edited by: xpcomputers