We need a php function that can backup a file to a directory.
The function has the following arguments
backup(file-to-backup, destination-folder, retention-policy)
The logic is quite simple:
if the file doesnt exit in the destination folder, copy the file to <destination-folder>/<filename>/<currenttime>
If the file (i.e.. the folder) exists in the destination folder,
if the filedates are the same, skip,
else create a new version.
delete the old version based on a retention policy.
Retention policy is the most complicated part. It allows me to specify what to do with the old versions. For example, I should be able to specify that only the last version should be kept, or all versions should be kept or anything in between.
Each retention policy is an XML struct that specifies what to do with old versions. For example, we should be able to specify
1 version per day for each day of the week for the last week,
1 version per every wednesday for 3 weeks
1 version per every sunday for 6 weeks
1 version for the 15th and the last day of the month for 6 months
1 version for the last day of the year for 10 years
to be kept
The schema for the retention policy and the algorithm will be sent.
A nicely written test program needs to be supplied.
## Deliverables
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables):
a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment.
b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request.
3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).
## Platform
PHP 5.x