Keep up to date copy of the blog on your PC with Windows (but also Linux and OSX) | Flavio's blog
 

Keep up to date copy of the blog on your PC with Windows (but also Linux and OSX)

in OSX Ubuntu Windows | | 2 Comments » | Last modified:

many want, Look for paranoia, either because they want to be protected from any hosting problem or accidentally overwriting files, a local copy on your hard drive for all your site.

If it is easy to control the static pages of your site, the theme and all the original files of your blog / site, the same can not be said for the files that are loaded when, during the writing of a post, you want to insert an image, a video, or any other media. We also think of when a plugin is automatically updated.
Sure you could every time you load a media file, open the ftp, look for the path of the uploaded file, copy it to the local folder on your hard drive, but it is not exactly the most comfortable…

To do this, you can use wget and a batch file (o uno script in bash sotto Unix)

The binary file for windows in wget can be downloaded at this address

Then you creaun batch file with this code:

@echo off
cls
d:\wgetwget --no-host-directories -x -r -N -l inf -k ftp://ftp.address.it/blog/ --ftp-user=user@host.it --ftp-password=miapassword -P "D:\mysite"
File echo the updated blog

with d:\wgetwget.exe the hypothetical path to the wget, those parameters are passed to analyze recursively with all subfolders of the folder / blog / and copy ONLY the newer files in the folder hypothetical D:\miositoblog.

Note that, in local destination path, Enough only put in the root folder Site.

Now just do Double-click the newly created file .BAT, and after a few seconds (or minutes:) ) your local copy of the blog will match the remote copy, you want to upload media files, either because a plugin has been automatically updated, in the meantime had changed and no longer corresponded to the original copy.

It, instead of using Windows, Linux or Mac if utilizzasse, just use the analog of wget binary for Unix, and use a path. The parameters to pass to wget are obviously the same regardless of operating system.

 

2 Comments »

Please accept third-party cookies to be able to comment on the post! The CHANGE COOKIE CHOICES button is located in the footer of the site. / In order to comment this post, please accept the third party cookies! The button CAMBIA LE SCELTE DEI COOKIE is in the footer of the website.