Skip to content

Instantly share code, notes, and snippets.

View gjaekel's full-sized avatar

Guido Jäkel gjaekel

  • Deutsche Nationalbibliothek
  • Frankfurt/Main, Deutschland
View GitHub Profile
@gjaekel
gjaekel / _restic-remote-backup
Created February 6, 2026 07:23
Restic Remote Backup Script to be called on Backup Server
#!/bin/bash
#
# 20231229/gj
# 20240208/gj root user check
# 20260206/gj add repository option
if [ -z "$1" ]; then
cat >&2 <<-EOT
syntax : $0 <host> [repository]
purpose: - wol host if required
@gjaekel
gjaekel / _restic-backup
Created February 6, 2026 06:58
Restic Local Backup Script to be called by
#!/bin/bash
#
# 20240316/gj
# 20260206/gj public version
#
# to be used on client's anachron as /etc/cron.daily/restic-backup
LOGFILE="/var/log/restic-backup.log"
@gjaekel
gjaekel / _restic.foo
Created February 6, 2026 06:43
Restic Wrapper
#!/bin/bash
#
# 20231229/gj
# 20240314/gj keep policy
# 20240315/gj backup ALL meta source
# 20240330/gj AUTO-DRY --yes
# 20241112/gj disable cache
# 20241110/gj mention about dry run
# 20241207/gj set TMPDIR to cache dir
# 20250221/gj ensure existence of TMPDIR
@gjaekel
gjaekel / nrof
Created September 16, 2021 08:03
Display Number of Open Filehandles in total or grouped by kind of Files, Sockets, Pipes, Anon_INodes, for all processes or a ceratain PID
#!/bin/bash
#
# 20141126/gj
# 20150219/gj pipes
# 20190225/gj 'all' command
# 20191107/gj add anon_inode
# 20191007/gj get fd stats once
# 20200616/gj get limits
# 20200806/gj get limits via /etc/security/limits.conf because smnpd is startet with lower limits
# 20200919/gj skip comments in limits.conf