M bin/runbackup.sh +12 -14
@@ 1,33 1,29 @@
#!/bin/sh
if [ "$1" = "--delete" ]; then
- ROPTS="-azv --delete"
+ ROPTS="-rv --delete"
else
- ROPTS="-azv"
+ ROPTS="-rv"
fi
PKG_BACKUP_PATH="/home/pjs/.config/misc_conf_backup"
RSYNC_BACKUP_PATH="/media/pjs/thinkpad_backup"
BACKUP_SOURCE_PATH="/home/pjs"
-# Export package list first (2 methods ... just because?)
-echo "Getting package listings..."
-dpkg --get-selections > $PKG_BACKUP_PATH/dpkg_get_selections.txt
-apt list --installed > $PKG_BACKUP_PATH/apt_installed.txt
-
-# pip modules
-echo "Getting Python modules..."
-pip2 freeze > $PKG_BACKUP_PATH/pip2_freeze.txt
-pip3.6 freeze > $PKG_BACKUP_PATH/pip36_freeze.txt
-pip3.7 freeze > $PKG_BACKUP_PATH/pip37_freeze.txt
-pip3.8 freeze > $PKG_BACKUP_PATH/pip38_freeze.txt
+mkdir -p $PKG_BACKUP_PATH
echo "Getting system config files..."
for FILE in `cat $PKG_BACKUP_PATH/../backup_system_config_files.txt`; do
NFILE=$(echo $FILE | sed -e 's/\//__/g')
- cp -Rp $FILE $PKG_BACKUP_PATH/$NFILE
+ doas cp -Rp $FILE $PKG_BACKUP_PATH/$NFILE
done
+echo "Getting package listings..."
+apk list -I > $PKG_BACKUP_PATH/apk_list_installed.txt
+
+echo "Getting Python modules..."
+pip3 freeze > $PKG_BACKUP_PATH/pip3_freeze.txt
+
echo "Dumping crontab..."
crontab -l > $PKG_BACKUP_PATH/pjs_crontab.txt
@@ 41,5 37,7 @@ rsync $ROPTS --exclude-from "$PKG_BACKUP
echo "Cleaning up..."
rm -rf $PKG_BACKUP_PATH/*
+printf "%s: Completed backup\n" "$(date -Iseconds)" >>$RSYNC_BACKUP_PATH/backup.log
+
sleep 2
sync
M vim/vimrc +16 -0
@@ 35,6 35,16 @@ if &term =~ "xterm-debian" || &term =~ "
set t_Sb=[4%dm
endif
+" Vimdiff
+if &diff
+ set cursorline
+ map ] ]c
+ map [ [c
+ hi DiffAdd ctermfg=233 ctermbg=LightGreen guifg=#003300 guibg=#DDFFDD gui=none cterm=none
+ hi DiffChange ctermbg=white guibg=#ececec gui=none cterm=none
+ hi DiffText ctermfg=233 ctermbg=yellow guifg=#000033 guibg=#DDDDFF gui=none cterm=none
+endif
+
" Vim5 comes with syntaxhighlighting. If you want to enable syntaxhightlighting
" by default uncomment the next three lines.
"if has("syntax")
@@ 146,6 156,12 @@ augroup aerc
autocmd FileType mail setlocal fo+=aw tw=72
augroup END
+augroup json
+ au!
+ au BufRead,BufNewFile *.json set filetype=json
+ autocmd FileType json nmap <leader>J :%! jq<cr>
+augroup END
+
endif " has ("autocmd")
" Some Debian-specific things