|
#1
|
|||
|
|||
|
What are you you using to automatically delete files and folders on a site and replace them with the original ones?
I am busy writing an application and I need to ability to allow visitors to "test" the system, but need to get rid of the test info lets say every 3 hours and replace it with the original data. It will include db info (easy enough) and files and subfolders. I found a couple of scripts to do that with but would like to know what the rest of you suggests. |
|
#2
|
||||
|
||||
|
I would put the originals in a non public area of the site, and set a cron to do a "cp" over to the test area every 3 hours.
__________________
Follow me on Twitter! http://twitter.com/mrw |
|
#3
|
|||
|
|||
|
Quote:
I was looking at these examples. http://uk.php.net/copy but was wondering if anyone had a better idea. |
|
#4
|
||||
|
||||
|
What script would you need?
Code:
cp -fr /home/user/theoriginal /home/user/public_html/thedestination
__________________
Follow me on Twitter! http://twitter.com/mrw |
|
#5
|
|||
|
|||
|
Thanks for this, I never used them before.
What would be the command for deleting files and directories? |
|
#6
|
|||
|
|||
|
Found a list of commands and usage here http://www.linuxdevcenter.com/linux/cmd/
Thanks for the pointer in the right direction. |
|
#7
|
||||
|
||||
|
rm to remove, but if you do a cp with the -f option it forces the overwrite.
__________________
Follow me on Twitter! http://twitter.com/mrw |
|
#8
|
|||
|
|||
|
Yea got it thanks.
I had to use rm as well as the system allows to create subdirectories. It is working perfectly
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
|
|
All times are GMT -5. The time now is 09:08 PM.









