[Shell] Personal dotfiles and scripts to deploy them.
Scripts for admin
Table of Contents
#+begin_abstract The code blocks contained in this Smart Document are Bash and Python scripts that automate certain sysadmin tasks on my local box. #+end_abstract
Helper functions
These helper functions were adapted from the Guix project.
#+NAME: helper-functions
timestamp(){date--rfc-3339=s;}_err(){# All errors go to stderr.printf""$(date+%s.%3N)""$1""""$(date--rfc-3339=s)""$1""${DEBUG}""""$(date+%s.%3N)""$1"$1"$1"$yn""
Backup
This scripts
<<helper-functions>>
bkp_dirs=("~/Desktop" \
"~/Documents" \
"~/git" \
"~/Music/" \
"~/org/" \
"~/.emacs.d")
_msg "Preparing backup..."
_msg "List of directories to backup:"
# printf "%s\n" ${bkp_dirs[]}
for file in $(ls)
do
rsync -a $file bkp/
printf "Successfully sent file %s\n" $file
done
rsync -a ./ ./bkp
_msg "Backup was completed successfully!"
#+RESULTS:
[2022-01-23 16:30:36+01:00]: Preparing backup...
[2022-01-23 16:30:36+01:00]: List of directories to backup:
Successfully sent file Makefile
Successfully sent file README.org
Successfully sent file bashrc.org
Successfully sent file bkp
Successfully sent file herbstluftwm-autostart.org
Successfully sent file panel.sh
Successfully sent file scripts.org
Successfully sent file test.ml
Successfully sent file xinitrc.org
[2022-01-23 16:30:36+01:00]: Backup was completed successfully!