Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ======================================
- /usr/local/bin/pm_zypper_patch.bash
- ======================================
- #!/usr/bin/env bash
- # Author: Peter Maloney
- set -u
- type="${1:+$1}"
- if [ -n "$type" ]; then
- args=()
- args[0]="-g"
- args[1]="$type"
- fi
- echo "====================================="
- echo -n $(date "+%Y-%m-%d %H:%M:%S")" - "
- echo "zypper -n patch ${args[@]:+${args[@]} }-l"
- echo "====================================="
- zypper -n patch ${args[@]:+${args[@]} } -l
- ======================================
- /etc/logrotate.d/pm_zypper.lr
- ======================================
- /var/log/pm_zypper_patch.log {
- compress
- dateext
- notifempty
- missingok
- nocreate
- maxage 60
- rotate 10
- size 10M
- }
- ======================================
- /etc/cron.d/pm_zypper
- ======================================
- PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin
- # Refresh repos daily
- 0 1 * * * root zypper -n refresh >/dev/null 2>&1
- # Security patches daily
- 0 2 * * * root pm_zypper_patch.bash security >> /var/log/pm_zypper_patch.log 2>&1
- # all patches daily
- #0 2 * * * root pm_zypper_patch.bash >> /var/log/pm_zypper_patch.log 2>&1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement