Jump to content

File getting under conditions


Asheeown

Recommended Posts

I have a program that gets a file from a website ungzips it and inputs that data into the database, however I would like to put this file onto a cron job and have it download the most recent file that hasn't already been downloaded.

Just say it if you need any more detail to fully understand
Link to comment
https://forums.phpfreaks.com/topic/35116-file-getting-under-conditions/
Share on other sites

These are provided by the company we use for tracking

[quote]
cdr_20070121000000-daily.csv.gz
[/quote]
the name includes the the year first "2007", in this case, then the month "01", in this case, then it has a unique id after the month and that would be "21" for this one
Well I can use a database table to compare what i'm downloading but the problem is downloading files that I'm not even sure are there.

Meaning when you do a file script and plain and simple call the file by saying file(file.gz) but when I want to run this script on a cronjob and have it automated how will php get all the file names from the directory?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.