Results 1 to 5 of 5
  1. #1
    ABW Ambassador Ron Bechdolt's Avatar
    Join Date
    January 18th, 2005
    Location
    Affiliateville, USA
    Posts
    7,927
    Can anyone tell me how I might unzip a datafeed file on my server using a cron job?

    I've tried some ideas in the command line for the cpanel cron job set up, but no luck. I tried to do a php script to do it, but no luck there either. I'm sure I'm missing something simple here.

    Any suggestions much appreciated.
    Ron Bechdolt | Affiliate Program Management Consultant
    7 Days A Week Marketing

  2. #2
    ABW Ambassador
    Join Date
    January 18th, 2005
    Posts
    718
    How about getting your CRON job to run a PERL script that does the ncessary?

  3. #3
    ABW Ambassador Ron Bechdolt's Avatar
    Join Date
    January 18th, 2005
    Location
    Affiliateville, USA
    Posts
    7,927
    Perl sounds good, but I would not know the first thing about doing it. I do know how to make a perl script run from a cron job, just don't know how to write the script in perl.

    Any suggestions would be greatly appreciated.



    Thanks.
    Ron Bechdolt | Affiliate Program Management Consultant
    7 Days A Week Marketing

  4. #4
    Newbie
    Join Date
    January 18th, 2005
    Posts
    47
    <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by 7-days:
    Can anyone tell me how I might unzip a datafeed file on my server using a cron job?

    I've tried some ideas in the command line for the cpanel cron job set up, but no luck. I tried to do a php script to do it, but no luck there either. I'm sure I'm missing something simple here.

    Any suggestions much appreciated. <HR></BLOCKQUOTE>

    Do you have unzip on your server?

    You can do something like this in php :

    passthru('/path/to/unzip zipedfile.zip');

    And launch this script throught crontab using lynx or wget.
    <a href="http://www.freemobilefun.net">Free cell phone wallpapers</a>
    <a href="http://www.allmyringtones.com">Cell phone ringtones</a>

  5. #5
    Newbie
    Join Date
    March 8th, 2005
    Posts
    13
    I realize I am quite late with responding to this thread, but perhaps it's of some use to someone.

    From the php.net site an example code can be found (http://www.php.net/manual/en/ref.zip.php):
    PHP Code:
    <?php

    $zip 
    zip_open("/tmp/test2.zip");

    if (
    $zip) {

       while (
    $zip_entry zip_read($zip)) {
           echo 
    "Name:              " zip_entry_name($zip_entry) . "\n";
           echo 
    "Actual Filesize:    " zip_entry_filesize($zip_entry) . "\n";
           echo 
    "Compressed Size:    " zip_entry_compressedsize($zip_entry) . "\n";
           echo 
    "Compression Method: " zip_entry_compressionmethod($zip_entry) . "\n";

           if (
    zip_entry_open($zip$zip_entry"r")) {
               echo 
    "File Contents:\n";
               
    $buf zip_entry_read($zip_entryzip_entry_filesize($zip_entry));
               echo 
    "$buf\n";

               
    zip_entry_close($zip_entry);
           }
           echo 
    "\n";

       }

       
    zip_close($zip);

    }

    ?>
    Suppose you called the php file unzip.php, then the CRON job could look like this:

    /usr/bin/wget -O/dev/null -q http://www.foo.com/bar/unzip.php

    That's about it.

    Rolf

  6. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. cron job unzipping protocol
    By Ron Bechdolt in forum Programming / Datafeeds / Tools
    Replies: 3
    Last Post: February 10th, 2010, 11:41 AM
  2. Help setting my cron job!
    By Ricardo Dacosta in forum Programming / Datafeeds / Tools
    Replies: 1
    Last Post: June 19th, 2008, 09:35 AM
  3. Cron Job Question
    By Doug247 in forum Programming / Datafeeds / Tools
    Replies: 9
    Last Post: March 18th, 2008, 01:13 PM
  4. Unzipping a file
    By boningroup in forum Midnight Cafe'
    Replies: 13
    Last Post: December 11th, 2007, 05:14 AM
  5. Cron job
    By templus in forum ShareASale - SAS
    Replies: 22
    Last Post: July 29th, 2007, 03:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •