|
|
![]() |
|||
    I wrote this snippet of code the other day for work...thought someone out there might find it useful...its free to use assuming you don't make any money from it and all that great stuff...in essence it FTP's in and downloads all the files from $start_dir down and saves them to a compressed tar.gz based on the date. You can change the days to keep logs more or less...ect...at the end there is also a mysql backup portion which will gather all the databases and tables and such and save them all to a big insert file all tar.gz'd up. You'll notice that it makes seperate folders for each backup date...this way you could backup multiple folders, multiple websites, ect. if you put one giant for() loop around the whole thing....then you can pull the vars you need in from a text file or like mine a database. I recommend running this from the PHP CLI as it will probably take longer than the default 30 seconds to run. Hope you all enjoy. ...you know i just had a thought....could you run:
system("nohup php myfile.php &"); to start a PHP CLI from the web? ...i'll have to try this later. and in case you were curious the nohup keeps a program/script running even after you logout and the & simply puts the job in the background....on a linux box of course :-) There are no comments for this post yet.
|
|||||
|
Server has been up: 189 days 1 hrs 37 mins and 47 secs Built in 0 secs.
|
|||||