Periodic tasks¶
Review root access¶
Read the root access policy
Update the
ssh.root
lists in Pillar files and thessh.admin
list in thepillar/common.sls
fileDeploy the affected services
Clean root user directory¶
Run:
./run.py '*' cmd.run 'ls'
Leave any
post.install.log
filesDelete any
index.html*
filesThese are created when a developer runs
wget
commands to e.g. test proxy settings.
Check drive usage¶
If ncdu
is installed, change to the root directory, and run the ncdu
command.
To clear space:
apt-get clean
Note
A cron job prunes Docker daily.
Check mail¶
Find saved messages across servers:
./run.py '*' cmd.run 'find /root /home/* -maxdepth 0 -name mbox'
Find mailboxes with mail across servers:
./run.py '*' cmd.run 'find /var/mail -type f -not -size 0'
Connect to a server, and open a mailbox:
mail -f /var/mail/root
You might see a lot of repeat messages.
Here are common commands:
number: open that message
h
: show a screen of messagesz
: go to the next screend 5-10
: delete the messages 5 through 10d *
: delete all messagesq
: save changes and exitx
: exit without saving changes
In most cases, all messages can be ignored and deleted. Relevant messages might include:
- Failed cron jobs
Try to correct the failure
- Failed attempts to use sudo
If the attempt is not attributable to a team member, discuss security measures
Auto-remove packages¶
To show the packages that were automatically installed and are no longer required:
./run.py 'docs' pkg.autoremove list_only=True
It is generally safe to remove these. Run:
./run.py 'docs' pkg.autoremove purge=True
You can omit purge=True
to make it easier to restore a package.
To show the packages that were removed but not purged, run:
./run.py '*' pkg.list_pkgs removed=True
Upgrade Ubuntu¶
To determine the current releases, run:
./run.py '*' cmd.run 'lsb_release -a'
To check the long term support of the releases, consult the Ubuntu documentation.