Compare commits
No commits in common. "3e51c233407ced532bc053694f38258d4fd57a3e" and "a7e218c666cd30037950cad517e25517b92eb88d" have entirely different histories.
3e51c23340
...
a7e218c666
3 changed files with 5 additions and 12 deletions
|
|
@ -1,6 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Delay the run for 15 hours (from midnight) and then run at a random time within 3 hours after that.
|
||||
sleep $(( 54000 + (RANDOM % 10800) ))
|
||||
|
||||
/usr/sbin/dehydrated -c >/dev/null
|
||||
|
|
|
|||
|
|
@ -11,19 +11,15 @@
|
|||
|
||||
# Create package list depending on system type.
|
||||
case "$ID" in
|
||||
'alpine')
|
||||
apk list -I | cut -d' ' -f1 | rev | cut -d- -f3- | rev >/etc/pkglist
|
||||
;;
|
||||
'debian'|'ubuntu')
|
||||
dpkg-query --show --showformat='${Package}\n' >/etc/pkglist
|
||||
/usr/bin/dpkg-query --show --showformat='${Package}\n' >/etc/pkglist
|
||||
;;
|
||||
'slackware')
|
||||
slackpkg -batch=on -default_answer=y generate-template "$(hostname --short)" >/dev/null
|
||||
[[ -L /etc/pkglist ]] && rm -f /etc/pkglist
|
||||
ls -1 /var/log/packages/ | rev | cut -d- -f4- | rev >/etc/pkglist
|
||||
/usr/sbin/slackpkg -batch=on -default_answer=y generate-template "$(hostname --short)" >/dev/null
|
||||
[[ ! -e /etc/pkglist ]] && ln -sf "/etc/slackpkg/templates/$(hostname --short).template" /etc/pkglist
|
||||
;;
|
||||
'void')
|
||||
xbps-query -l | awk '{ print $2 }' | rev | cut -d- -f2- | rev >/etc/pkglist
|
||||
/usr/sbin/xbps-query -l | awk '{ print $2 }' | rev | cut -d- -f2- | rev >/etc/pkglist
|
||||
;;
|
||||
*)
|
||||
printf "%s: %s\\n" "${BASH_SOURCE[0]}" "Unsupported system." >&2
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ mountpoint "$BACKUP_MOUNTPOINT/" >/dev/null 2>&1 || {
|
|||
}
|
||||
|
||||
# Do the backup.
|
||||
ionice -c Idle nice -n 19 rsync "${RSYNC_OPTIONS[@]}" "${RSYNC_OPTIONS_VERBOSE[@]}" "${RSYNC_FILTER[@]}" "$RSYNC_SOURCE" "$BACKUP_DESTDIR" >"$RSYNC_LOG" 2>&1
|
||||
rsync "${RSYNC_OPTIONS[@]}" "${RSYNC_OPTIONS_VERBOSE[@]}" "${RSYNC_FILTER[@]}" "$RSYNC_SOURCE" "$BACKUP_DESTDIR" >"$RSYNC_LOG" 2>&1
|
||||
ERR="$?"
|
||||
|
||||
# Send a notification and mail a log if there were errors.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue