This option is a simplified form of the --filter option that specifies an exclude rule and does not allow the full rule-parsing syntax of normal filter rules.
This is equivalent to specifying -f'- PATTERN'.
See the FILTER RULES section for detailed information on this option.
To check your rules you can use:
--dry-run --debug=FILTER
see more info using --debug=help
Im using these options to synchronize my original and backups in my personal script:
/etc/named/bin/backup
#!/usr/bin/env bash
#
_backupsRoot='/mnt/btrfs_rootfs/Backups'
# Sync to backups
bkdirs+=(
"${_backupsRoot}"/@for_new_machines/etc/named
)
function main {
opts_rysync=(
--verbose
# --dry-run --debug=FILTER
--archive
--acls --xattrs
--info=NAME1,BACKUP1,DEL1,REMOVE1
--delete
--inc-recursive
--exclude-from=/etc/named/bin/.rsync-exclude --delete-excluded
)
for bkdir in "${bkdirs[@]}"; do
test ! -d "$bkdir" && continue
case "$bkdir" in
*named)
# Sync named dir recursively
echo -e "\nSyncing named to: $bkdir"
sudo rsync "${opts_rysync[@]}" /etc/named "${bkdir%/named}"
;;
*)
;;
esac
done
sync
}
#shellcheck disable=SC2312
if test "$(id -u)" -ne 0; then
exec pkexec "$0" "$@" || exit
else
main "$@"
fi
(I know it could be coded a lot simpler, but i use the same logic for multiple stuff, so itâs just a copy and replace certain parts kind-of-thing for me)
Good⊠call me lazy, but making the same task more complex is not a benefit. Create a GUI for this, and I am on board, but systemd timers can not beat crontab in simplicity.
I donât really like the GUI for that type of thing, so text-based is more than perfect for me.
Whatâs more, Systemd-timer unitsâ time definitions are, according to me at least, also much easier to understand. Never could wrap my head around that. I felt kind of stupid because of it, but it didnât discourage me from Linux, luckily.
PS: The cron syntax is from the time when computers had scares resources, from the same era where cryptic and spaghetti programming were needed to save bytes.
This has since then been completely de-favored in favor of human readability and understandabilityâŠ
The purpose this millennium is not to have a 1-byte command do something you need, this millennium is all about human-understandable code aside from the one coding it and to prevent bugs.
Here are some links to the sub-topic we derailed into: