FTP Sync 0.9
PURPOSE:
To upload files which have changed to your production server , automating the task of comparing which files have changed. You simply create a FTP job
in the script , run the job and it will upload the changed files for you.
REQUIREMENTS:
FTP functions are required for this script to work.
PHP 4 Or 5
MySQL 4+
INSTALL:
Open dbinc.php and put in the database connection variables in there. Once done run installer.php from your browser and you are all set to go.
Its advised to remove installer.php once you have finished installation.
SECURITY:
It if advised that the admin creates users and allocates jobs to them. Also the admin should block access to the database and script files
from general staff.
INFO:
We made this script for our internal use , thought it might be useful for some of you out there. It was a tiring job to find which files needed to be uploaded
to the main server after development on local server. Thus i created this script , where you can create jobs and upload folders and files which were changed.
The decision to upload happens on 3 rules:
1 : you can provide time and date in the job page , files which were created after that time will be uploaded.
2 : you can ask the script to match the time against the server file , the script would calculate the time offset and calculate if the file has
changed since last upload.
3 : The script also keeps a log , if the file changed after last upload , it will upload the file.
You can exclude the files you dont want to upload, for instance you wont want to upload and overwrite config.php or something like that. So you
can create the skip list. The skip list is the path of the file from the source directory you have provided.
For instance if you have a source directory called “/www/something/upload/” , and you dont want to upload the file “/www/something/upload/config.php”
or the folder “/www/something/upload/users/images” then you would put in something like this:
config.php
users/images
Remember no trailing slash for folders.
You need to have writable permissions for the logs folder , also if you want to utlize the copy permissions feature you will need the BcMath library
compiled with PHP.
The admin can run any job , but if you want to have users which can run specific jobs only please utilize the users section , in which a user can
run all jobs or only specific jobs.
Same goes for the jobs , you can set an attribute to allow all users to run the job.
This code has been tested on PHP 5 and PHP 4.4.
You are free to modify the code as you please. The code is released in the public domain under the GPL license.
Enjoy!