Published by Niels on 26 Nov 2005
First release of sl (0.0.1)
Suppose you have a website using NanoBlogger and you want to upload the changes to your provider. Then you can use something like rsync. But if that functionality is not supported by your provider you can either:
- Upload the changes manually
- Upload the entire site again, which can be costly and time consuming once your site gets large
- Write something to keep track of the differences and uploads only those differences to the host
I choose the latter and the prototype seems to be working fairly well for me. It keeps track of the MD5 sums and the names of the current directories in the
website’s local directory. If any changes are made the the new files’ MD5 checksums and directory structure are compared to the stored one. A list of changes to the remote site will then be made in commands understood by sftp. These commands are executed and presto: an updated site!
Its usage is very simple:
sl [OPTION] source destination
In the example below only the script only performs a dry-run so you can see the possible changes without affecting your website.
sl -t websitedir user@remoteserver.domain.com
The script can be downloaded here.
If there are any suggestions or comments feel free to contact me.