I need a script that can do the following
1 - Will check for newly uploaded files every hour on server 1
2 - If it finds a new file it will transfer it over to server 2
3 - Once file is copied to server 2 i need some sort of button to appear on my site to let people know there is an alternate mirror to download the file.
If there is no mirror for the file then the button must not appear on the site
I need the script to continuously do this and overwrite old files (so long as they are not in use) for the most recent uploaded ones, as the most recent uploads will use most of the bandwidth.
I would also like to keep the 50 most downloaded files of each week on the secondary mirror. I believe this can be done using MySQL table: hitsThisHour
## Update - Please see below for a more detailed description {#post_message_7158472}
I will have 1 dedicated server that will act as the main host (i host over 800gb of files) and 1 vps which will act as the mirror for US based users. The VPS will host the most recent uploaded files (10-20gb).
A user will upload their file to the dedicated server and use the site normally.
Once the file has been uploaded to the dedicated server it needs to be copied over to the VPS server.
Once the file is on both servers i would like an additional download button to appear on the sites mix page, which is the landing page for users wanting to download the file, showing a US mirror is available for download.
As the VPS mirror will only host 20gb of the most recent files it means that older files will not have a US mirror. If this is the case then i need the download button to be removed from the mix page. So that only the normal download button is available.
Download stats will need to be recorded from the VPS and included into the sites current counter.
The site is built around smarty php i believe, and uses a custom cms which belongs to the company who initially created the site.
If possible i would like to be able to manually include files myself as there are some very popular files that i would always like to have a mirror. If it can be included into the cms that would be great.