Copying File Using PHP

Fertiggestellt Veröffentlicht Jan 6, 2006 Bezahlt bei Lieferung
Fertiggestellt Bezahlt bei Lieferung

Hi there

This should be a very simple project for someone who knows what they are doing with PHP scripts.

I would like a simple PHP script that sorts through the file names in a particular directory on my web-server and copies the most recent file (based on it's name) to a directory higher up the structure. The file names in the directory are all in the form:

[login to view URL]

[login to view URL]

[login to view URL]

..etc

...and are mysqldumps of a mySQL database in ASCII text.

The PHP script should have the directory in which the files are stored and the directory to which the file will be copied, coded as variables at the top of the script - as this script will be used to perform a similar task on more than one site. The script should not require any user input, as it will eventually run as a Cron task on a daily basis.

Warmest Regards

Paul

## Deliverables

Hi there

To give a bit of background: I have a large mySQL database that is backed up every day at varying times and is given a file name according to the date and time it was created.

These daily files are large (circa 400Mb) and unless I regularly delete old files, they accumulate over time and send me over the bandwidth I am allowed for my tape-based server backups - and then I get charged extra. So I am planning to exclude the directory where all the files are stored from my tape-backups and copy the most recent file higher up the directory structure (this is where you come in) so I always have a tape backup of the most recent file.

So, I would like a very simple PHP script that sorts through the file names in a particular directory on my web-server and copies the one most recent file (based on it's name) to a directory higher up the structure and gives the file a new file name. The relevant file names in the directory are all in the exact form:

[login to view URL]

[login to view URL]

[login to view URL]

..etc

i.e.:

[login to view URL]

MMM are months of the year and will all be 3 characters, i.e.: Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Nov, Dec.

All files are mysqldumps of the mySQL database in ASCII text. It is possible there may be other files in the directory that are not named in this format. These files should be ignored.

The PHP script should have the directory in which the files are stored, the directory to which the file will be copied and the new file name, coded as variables at the top of the script - as this script will be copied and edited to perform a similar task on more than one site. The new file name will usually already exist in the directory to which it is being copied and so it should overwrite the existing file.

The script should not require any user input, as it will eventually run as a Cron task on a daily basis.

It is important that the most recent file is found using the file name, rather than the datestamp on the file itself.

For compatibility: the server is running PHP v4.3.2-26, however access to this server for testing will not be available.

Warmest Regards

Paul

## Platform

PHP v4.3.2-26 compatible

Ingenieurwesen Linux MySQL PHP Softwarearchitektur Testen von Software

Projekt-ID: #3195573

Über das Projekt

38 Vorschläge Remote Projekt Aktiv Jan 9, 2006

Vergeben an:

VSquash

See private message.

$29.75 USD in 5 Tagen
(225 Bewertungen)
7.3

38 Freelancer bieten im Durchschnitt $33 für diesen Job

progwriter

See private message.

$80.75 USD in 5 Tagen
(620 Bewertungen)
7.7
javaoraclepro

See private message.

$59.5 USD in 5 Tagen
(167 Bewertungen)
7.5
zeurois

See private message.

$68 USD in 5 Tagen
(57 Bewertungen)
7.2
atandrau

See private message.

$17 USD in 5 Tagen
(99 Bewertungen)
6.5
corecpp

See private message.

$25.5 USD in 5 Tagen
(89 Bewertungen)
6.3
emberke

See private message.

$25.5 USD in 5 Tagen
(132 Bewertungen)
6.2
zubairuddin

See private message.

$25.5 USD in 5 Tagen
(71 Bewertungen)
6.5
silver82

See private message.

$29.75 USD in 5 Tagen
(159 Bewertungen)
6.2
codersarge

See private message.

$42.5 USD in 5 Tagen
(38 Bewertungen)
5.8
synbiant

See private message.

$42.5 USD in 5 Tagen
(31 Bewertungen)
5.0
mesh2005vw

See private message.

$4.25 USD in 5 Tagen
(107 Bewertungen)
5.1
redcom

See private message.

$28.9 USD in 5 Tagen
(167 Bewertungen)
5.4
davincisoftvw

See private message.

$21.25 USD in 5 Tagen
(45 Bewertungen)
4.6
normannormal

See private message.

$4.25 USD in 5 Tagen
(75 Bewertungen)
5.0
CodingCops

See private message.

$25.5 USD in 5 Tagen
(47 Bewertungen)
4.6
setjmp

See private message.

$21.25 USD in 5 Tagen
(58 Bewertungen)
5.1
resolutionsvw

See private message.

$17 USD in 5 Tagen
(18 Bewertungen)
3.9
goodspec

See private message.

$50.15 USD in 5 Tagen
(6 Bewertungen)
3.6
josbosmans

See private message.

$15.3 USD in 5 Tagen
(14 Bewertungen)
3.6
vw1614561vw

See private message.

$29.75 USD in 5 Tagen
(35 Bewertungen)
3.6