Copying File Using PHP

Виконано Опубліковано %project.relative_time Оплачується при отриманні
Виконано Оплачується при отриманні

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

Техніка Linux MySQL PHP Архітектура ПЗ Тестування ПЗ

ID Проекту: #3195573

Про проект

37 заявок(-ки) Дистанційний проект Остання активність Jan 9, 2006

Доручено:

VSquash

See private message.

$29.75 USD за 5 дні(-в)
(225 відгуків(-и))
7.3

37 фрілансерів(-и) готові виконати цю роботу у середньому за $33

progwriter

See private message.

$80.75 USD за 5 дні(-в)
(620 відгуків(и))
7.7
javaoraclepro

See private message.

$59.5 USD за 5 дні(-в)
(167 відгуків(и))
7.5
zeurois

See private message.

$68 USD за 5 дні(-в)
(57 відгуків(и))
7.2
atandrau

See private message.

$17 USD за 5 дні(-в)
(99 відгуків(и))
6.5
corecpp

See private message.

$25.5 USD за 5 дні(-в)
(89 відгуків(и))
6.3
emberke

See private message.

$25.5 USD за 5 дні(-в)
(132 відгуків(и))
6.2
zubairuddin

See private message.

$25.5 USD за 5 дні(-в)
(71 відгуків(и))
6.5
silver82

See private message.

$29.75 USD за 5 дні(-в)
(159 відгуків(и))
6.2
codersarge

See private message.

$42.5 USD за 5 дні(-в)
(38 відгуків(и))
5.8
redcom

See private message.

$28.9 USD за 5 дні(-в)
(167 відгуків(и))
5.4
synbiant

See private message.

$42.5 USD за 5 дні(-в)
(31 відгуків(и))
5.0
mesh2005vw

See private message.

$4.25 USD за 5 дні(-в)
(107 відгуків(и))
5.1
davincisoftvw

See private message.

$21.25 USD за 5 дні(-в)
(45 відгуків(и))
4.6
normannormal

See private message.

$4.25 USD за 5 дні(-в)
(75 відгуків(и))
5.0
CodingCops

See private message.

$25.5 USD за 5 дні(-в)
(47 відгуків(и))
4.6
setjmp

See private message.

$21.25 USD за 5 дні(-в)
(58 відгуків(и))
5.1
resolutionsvw

See private message.

$17 USD за 5 дні(-в)
(18 відгуків(и))
3.9
josbosmans

See private message.

$15.3 USD за 5 дні(-в)
(14 відгуків(и))
3.6
vw1614561vw

See private message.

$29.75 USD за 5 дні(-в)
(35 відгуків(и))
3.6
scotsteam

See private message.

$25.5 USD за 5 дні(-в)
(9 відгуків(и))
3.3