Usei como exemplo o backup do /home, onde o script criará um tar.gz para cada usuário.

#!/bin/bash
#
clear
######## PARAMETROS ################
ARQUIVOTEMPORARIO=/tmp/temporario
PASTAQUEQUERFAZERBACKUP=/home/
ONDECOLOCAROBACKUP=/root/
#####################################
rm -rf $ARQUIVOTEMPORARIO
ls -1 $PASTAQUEQUERFAZERBACKUP > $ARQUIVOTEMPORARIO
HOJE=$(date +%d_%m_%Y)
######################
for i in `cat $ARQUIVOTEMPORARIO`; do
XX=`echo $i | cut -d '/' -f 1`
######################
tar czf $ONDECOLOCAROBACKUP/$XX_$HOJE.tar.gz $PASTAQUEQUERFAZERBACKUP/$XX 2>/dev/null
######################
done
rm -rf $ARQUIVOTEMPORARIO
######################
echo "Backup do dia $HOJE terminado!!!"

Outra forma:

#!/bin/bash
#
clear
######## PARAMETROS ################
ARQUIVOTEMPORARIO=/tmp/temporario
PASTAQUEQUERFAZERBACKUP=/home/
ONDECOLOCAROBACKUP=/root/
#####################################
ls -1 $PASTAQUEQUERFAZERBACKUP > $ARQUIVOTEMPORARIO
HOJE=$(date +%d_%m_%Y)
######################
for i in $( cat $ARQUIVOTEMPORARIO ); do
XX=`echo $i | cut -d '/' -f 1`
######################
tar czf $ONDECOLOCAROBACKUP/$XX_$HOJE.tar.gz $PASTAQUEQUERFAZERBACKUP/$XX 2>/dev/null
######################
done
######################
echo "Backup do dia $HOJE terminado!!!"

#! /bin/sh
#
#### PARAMETROS ##############
NOVOMAC="00:02:2D:45:22:20"
INTERFACE="eth0"
IP="10.1.1.2"
MASCARA="255.255.255.0"
GATEWAY="10.1.1.1"
####
ifconfig $INTERFACE down
ifconfig $INTERFACE hw ether $NOVOMAC
ifconfig $INTERFACE $IP netmask $MASCARA
route add default gw $GATEWAY
####

Colocado em Linux, Shell Script.
Comente!.

Fiz este script simples para monitoramento de serviços localmente e caso não esteja rodando ele reativa o mesmo.

#!/bin/sh
####################################
TEMP=/tmp/monitorservices
PS=`/bin/ps ax > $TEMP`
####################################
DHCP=`/bin/cat $TEMP | /bin/grep dhcpd | /usr/bin/wc -l`
echo $DHCP
if [ $DHCP == 0 ]; then
/usr/sbin/dhcpd
fi
####################################
SNMP=`/bin/cat $TEMP | /bin/grep snmpd | /usr/bin/wc -l`
echo $SNMP
if [ $SNMP == 0 ]; then
/etc/rc.d/rc.snmpd start
fi
####################################
POSTGRES=`/bin/cat $TEMP | /bin/grep postgres | /usr/bin/wc -l`
echo $POSTGRES
if [ $POSTGRES == 0 ]; then
/etc/rc.d/rc.postgres start
fi
####################################
APACHE=`/bin/cat $TEMP | /bin/grep httpd | /usr/bin/wc -l`
echo $APACHE
if [ $APACHE == 0 ]; then
/etc/rc.d/rc.httpd start
fi
####################################
SQUID=`/bin/cat $TEMP | /bin/grep squid | /usr/bin/wc -l`
echo $SQUID
if [ $SQUID == 0 ]; then
/bin/chmod 777 /squid/* -R
sleep 1
/usr/sbin/squid -z
sleep 1
/etc/rc.d/rc.squid start
fi
####################################
/bin/rm -rf $TEMP

Colocado em Linux, Shell Script.
Comente!.

-->