Not so long ago I installed in different locations a few PCs as servers.
I choose Ubuntu server edition 8.0.4 LTS (Long-Term Support) aka Hardy Heron, the latest LTS version available from Canonical.
I prefer the hard way, without the GUI. Sorry, I don't like Linux GUIs ;-)
That way I can control what is installed, and install just what is really useful for that particular machine, leaving precious resources to services that need them. There is also another advantage. Limiting possible security issues.
One of these servers, in particular, has to manage the nightly backup of another server, this time a Windows 2003, via rsync.
I created a bash script to do the job and scheduled it with crontab.
The script, during the process, creates a report that is saved as a zip archive when the work is finished.
I was wondering how could I get that file to check everything was fine, without remotely access the server.
The obvious response was. By e-mail.
I started hunting for information in search for the most elegant solution with the minimum impact on the system.
What I found, and I picked, to achieve my goal, are these two little gems.
Mutt "a small but very powerful text-based mail client for Unix operating systems" and No Brainer SMTP nbSMTP "a simple MTA to send your mails to another mail server via SMTP".
First step. Retrieve and install the two packages. In Ubunto the apt-get command is aimed at that.
sudo apt-get install mutt
sudo apt-get install nbsmtp
I created a user specific .muttrc containing these lines
# No need to keep copy of the outgoing messages
set copy=no
# Some changes to the message headers
set hdrs=yes
my_hdr From: Me the sender <me@mydomain.com>
# How to invoke nbsmtp
set sendmail="/usr/bin/nbsmtp -f me@mydomain.com -d mydomain.com -h my_isp_smtp_server.com"
and to complete the work, at the end of the bash script that is supposed to make the backup, I've added the line in charge of sending the message
mutt -s "Backup report" -a report.zip me@mydomain.com < messagebody.txt
"Backup report" - is the subject of the message (option -s)
report.zip - is the attachment (option -a)
me@mydomain.com - is the recipient
messagebody.txt - is the main body of the e-mail (read message from the file messagebody.txt)
The file messagebody.txt could be anything you want to insert as the body of the message being sent.
Last but not least :-) I've also inserted this line into crontab file
MAILTO=""
to avoid error warning in log file
nbSMTP does not support the -o arguments from sendmail, ignoring them
because every time a croned job is executed mail is sent to the owner of the crontab
What is this blog about?
Mainly it is for my personal use. Is a collection of my job experience and are inteded to be notes for my memory just in case I need them again in the future.
That said I hope these tips could be useful for someone else too
Why in English?
I like foreign languages, English in particular. So, I consider this a sort of training for my English :-)
sabato 27 dicembre 2008
domenica 21 settembre 2008
Windows XP Display Properties
Generally due to a virus attack, sometimes some pages under Display Properties are no longer available.
Run Regedit and search for
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\
Remove keys, if they are present
NoDispAppearancePage
NoDispBackgroundPage
NoDispScrSavPage
NoDispSettingsPage
Now the Display Properties should be OK.
If, also the Task Manager is grayed out, there is a chance to find this key too
DisableTaskMgr
that must be removed.
Run Regedit and search for
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\
Remove keys, if they are present
NoDispAppearancePage
NoDispBackgroundPage
NoDispScrSavPage
NoDispSettingsPage
Now the Display Properties should be OK.
If, also the Task Manager is grayed out, there is a chance to find this key too
DisableTaskMgr
that must be removed.
sabato 19 luglio 2008
How to change default umask Leopard, Tiger and Panther
If, for some reason, you need to change the default umask (022) in Mac OS X Leopard the following article helps you in achieving that goal.
The article refers to Leopard server.
I tried it on Leopard workstation and seems to work just fine too.
The same can be done for Mac OS X Tiger in Terminal
sudo defaults write -g NSUmask -int value
as stated in Command Line 10.4 2nd edition manual
The above example applies on Mac OS X Panther too.
*** BE CAREFUL ***
These changes could possibly have nasty consequences on the normal behaviour of the system.
The article refers to Leopard server.
I tried it on Leopard workstation and seems to work just fine too.
The same can be done for Mac OS X Tiger in Terminal
sudo defaults write -g NSUmask -int value
as stated in Command Line 10.4 2nd edition manual
The above example applies on Mac OS X Panther too.
*** BE CAREFUL ***
These changes could possibly have nasty consequences on the normal behaviour of the system.
giovedì 17 gennaio 2008
I don't want IPv6 in Ubuntu
By default all major distributions of Linux nowadays are IPv6 enabled.
That is true also for Ubuntu server v6.06.1 aka Dapper Drake.
Sometimes leaving IPv6 enabled can cause little annoyances.
Fire up your favourite text editor and sudo edit this file
/etc/modprobe.d/aliases
Replace the line alias net-pf-10 ipv6 with alias net-pf-10 off.
Restart the computer and check the result with this line
ip a | grep inet6
If nothing appears IPv6 has gone :-)
Read here the original article
That is true also for Ubuntu server v6.06.1 aka Dapper Drake.
Sometimes leaving IPv6 enabled can cause little annoyances.
Fire up your favourite text editor and sudo edit this file
/etc/modprobe.d/aliases
Replace the line alias net-pf-10 ipv6 with alias net-pf-10 off.
Restart the computer and check the result with this line
ip a | grep inet6
If nothing appears IPv6 has gone :-)
Read here the original article
Iscriviti a:
Post (Atom)