Skip to content

Instantly share code, notes, and snippets.

crontab -u
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
chmod u+x mailreboot.sh
nano mailreboot.sh
./reboot.sh | mail -s "Wireless Uptime" email@address.com
chmod u+x reboot.sh
nano reboot.sh
sshpass -f /password.txt ssh cisco@172.20.1.15 reboot.sh
sleep 240
sshpass -f /password.txt ssh cisco@172.20.1.9 reboot.sh
sleep 240
sshpass -f /password.txt ssh cisco@172.20.1.17 reboot.sh
sleep 240
sshpass -f /password.txt ssh cisco@172.20.1.16 reboot.sh
sleep 240
apt-get install sshpass
apt-get install mailutilis
vi reboot.sh
reboot
vi uptime.sh
get system uptime