Archive for March 8th, 2010

Disable Cron Mail

March 8th, 2010

It’s a really fustrating feature , cron keeps sending mails with the output of every job it executes.
You can disable this per job by editing the crontab file (# crontab -e) and reddirecting the stdout (output messages) and/or stderr (error messages) to /dev/null.

for stdout:

0 * * * * /path/to/script.sh > /dev/null

for stdout and stderr:

0 * * * * /path/to/script.sh &> /dev/null

Or you can globally disable it with the MAILTO variable:

# echo 'MAILTO=""' >> /etc/default/cron

Cannot save cisco running-config to startup-config

March 8th, 2010

If you cannot save the running config to startup-config on a cisco router/switch be sure to check your config-register, if it’s inappropriately configured the router/switch will ignore the startup-config.
The factory-default setting for the configuration register is 0×2102.

Check it by issuing a show version command in privileged EXEC mode:

router#show version
Cisco Internetwork Operating System Software
IOS (tm) C2600 Software (C2600-I-M), Version 12.2(28), RELEASE SOFTWARE (fc5)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2005 by cisco Systems, Inc.
Compiled Wed 27-Apr-04 19:01 by miwang
Image text-base: 0x8000808C, data-base: 0x80A1FECC
ROM: System Bootstrap, Version 12.1(3r)T2, RELEASE SOFTWARE (fc1)
Copyright (c) 2000 by cisco Systems, Inc.
ROM: C2600 Software (C2600-I-M), Version 12.2(28), RELEASE SOFTWARE (fc5)
System returned to ROM by reload
System image file is "flash:c2600-i-mz.122-28.bin"
cisco 2620 (MPC860) processor (revision 0x200) with 60416K/5120K bytes of memory
Processor board ID JAD05190MTZ (4292891495)
M860 processor: part number 0, mask 49
Bridging software.
X.25 software, Version 3.0.0.
1 FastEthernet/IEEE 802.3 interface(s)
32K bytes of non-volatile configuration memory.
63488K bytes of ATA CompactFlash (Read/Write)
Configuration register is 0x2142

Enter the global configuration mode and set it to the default value of 0×2102:

router#conf t
router(config)#config-register 0x2102

You can find a list of Configuration Registers here.