I originally created a simple site monitoring Python script and posted it up to github as a “gist”: 177420. It was then improved by Eric Wendelin who forked my original gist and made it better in this gist: 187610 .
Eric had made the script much more “pythonic” and really made the code more usable and expendable which he explains in his blog post, Site monitoring with Python and cron. He had made the script accept command line arguments and even added a way to send email through Python if you didn’t want to setup your own mail daemon.
I thought his additions were a great example of open source coding in action.
If you already have Dropbox you already know that it has a Public folder where you can save files for everyone to download. If you are using the GUI version of Dropbox you can even right click on the file and get a public link to hand out. Although this works great, we can automate this process and make it easier.
Create a folder on a large hard drive or raid your main computer/server
For example:
mkdir /meda/drobo/inhouseDropbox
On the repository machine install Unison
sudo apt-get install unison
On the local machine connect via SSH and test that the install went ok
ssh yourhostname unison -version
You should see something like, “unison version 2.27.57”.
Create a file in your repository directory:
test.txt
Rysnc helps you transfer data from one location to another in an efficient manner. It is one of those tools that you learn to use and wonder how you lived without it. Rsync is the de facto standard in backup solutions because of its flexibility and power.
Here are a few tasks that you might want to consider using the command line for.
Here are a few example of all the ways we can shutdown and reboot on a nix machine.
We talked about some of the benefits of setting up an email server in Linux and how you can use python to send email. Now we are going to look at how you can send email from Perl.