Merge remote-tracking branch 'origin/master' into debian
This commit is contained in:
commit
31e618be9e
@ -44,4 +44,5 @@
|
|||||||
"use_tab_stops": false,
|
"use_tab_stops": false,
|
||||||
"word_wrap": true,
|
"word_wrap": true,
|
||||||
"wrap_width": 120,
|
"wrap_width": 120,
|
||||||
|
"index_files": true,
|
||||||
}
|
}
|
||||||
|
3
scripts/archive_and_compress.sh
Executable file
3
scripts/archive_and_compress.sh
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
source=${1%/}; # cut off trailing "/"
|
||||||
|
tar cfv $source.tar $source && xz $source.tar;
|
@ -11,25 +11,26 @@ shopt -s expand_aliases # make aliases work
|
|||||||
|
|
||||||
BACKUP_DIR=/sync/backup
|
BACKUP_DIR=/sync/backup
|
||||||
BACKUP_DIR_HOME=$BACKUP_DIR/home
|
BACKUP_DIR_HOME=$BACKUP_DIR/home
|
||||||
if [[ !($HOME/.bash_aliases_local -ef $BACKUP_DIR_HOME/.bash_aliases_local) ]]; then
|
rsync_backup $HOME/.ssh/ $BACKUP_DIR_HOME/.ssh/
|
||||||
ln $HOME/.bash_aliases_local $BACKUP_DIR_HOME/.bash_aliases_local
|
|
||||||
fi
|
|
||||||
rsync_backup --link-dest="$HOME/.ssh/" $HOME/.ssh/ $BACKUP_DIR_HOME/.ssh/
|
|
||||||
|
|
||||||
BACKUP_DIR_ROOT=$BACKUP_DIR/root/etc
|
BACKUP_DIR_ROOT=$BACKUP_DIR/root/etc
|
||||||
sd rsync_backup --link-dest="/etc/ddclient/" /etc/ddclient/ $BACKUP_DIR_ROOT/ddclient/
|
sd rsync_backup /etc/ddclient/ $BACKUP_DIR_ROOT/ddclient/
|
||||||
sd rsync_backup --link-dest="/etc/letsencrypt/" /etc/letsencrypt/ $BACKUP_DIR_ROOT/letsencrypt/
|
sd rsync_backup /etc/ddclient.conf $BACKUP_DIR_ROOT/
|
||||||
sd rsync_backup --link-dest="/etc/nginx/" /etc/nginx/ $BACKUP_DIR_ROOT/nginx/
|
sd rsync_backup /etc/letsencrypt/ $BACKUP_DIR_ROOT/letsencrypt/
|
||||||
sd rsync_backup --link-dest="/etc/ssh/" /etc/ssh/ $BACKUP_DIR_ROOT/ssh/
|
sd rsync_backup /etc/nginx/ $BACKUP_DIR_ROOT/nginx/
|
||||||
sd rsync_backup --link-dest="/etc/wireguard/" /etc/wireguard/ $BACKUP_DIR_ROOT/wireguard/
|
sd rsync_backup /etc/ssh/ $BACKUP_DIR_ROOT/ssh/
|
||||||
if [[ !(/etc/ddclient.conf -ef $BACKUP_DIR_ROOT/ddclient.conf) ]]; then
|
sd rsync_backup /etc/wireguard/ $BACKUP_DIR_ROOT/wireguard/
|
||||||
ln /etc/ddclient.conf $BACKUP_DIR_ROOT/ddclient.conf
|
sd rsync_backup /etc/hosts $BACKUP_DIR_ROOT/
|
||||||
fi
|
sd rsync_backup /etc/docker/daemon.json $BACKUP_DIR_ROOT/docker/
|
||||||
|
|
||||||
|
|
||||||
#####################
|
#####################
|
||||||
### upload backup ###
|
### upload backup ###
|
||||||
#####################
|
#####################
|
||||||
|
|
||||||
|
if [[ "$1" == "--noupload" ]]; then
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
sd rsync_backup -e "ssh -i /home/edi/.ssh/id_ed25519" --filter="P /home/docker" /sync/backup/ fabian@garrus:/citadel/backup/edi/
|
sd rsync_backup -e "ssh -i /home/edi/.ssh/id_ed25519" --filter="P /home/docker" /sync/backup/ fabian@garrus:/citadel/backup/edi/
|
||||||
sd rsync_backup -e "ssh -i /home/edi/.ssh/id_ed25519" /home/edi/docker/ fabian@garrus:/citadel/backup/edi/home/docker/
|
sd rsync_backup -e "ssh -i /home/edi/.ssh/id_ed25519" /home/edi/docker/ fabian@garrus:/citadel/backup/edi/home/docker/
|
||||||
|
4
scripts/decompress_and_unarchive.sh
Executable file
4
scripts/decompress_and_unarchive.sh
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
source=$1;
|
||||||
|
archive=${source%.xz}; # cut off trailing ".xz"
|
||||||
|
unxz $source && tar xfv $archive
|
@ -11,6 +11,8 @@ replacements[':']='_';
|
|||||||
replacements["'"]='_';
|
replacements["'"]='_';
|
||||||
replacements['(']='_';
|
replacements['(']='_';
|
||||||
replacements[')']='_';
|
replacements[')']='_';
|
||||||
|
replacements['[']='_';
|
||||||
|
replacements[']']='_';
|
||||||
while [[ $# > 0 ]]; do
|
while [[ $# > 0 ]]; do
|
||||||
replacements["$1"]="$2";
|
replacements["$1"]="$2";
|
||||||
shift 2;
|
shift 2;
|
||||||
|
@ -2,13 +2,12 @@
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
sshMount () {
|
sshMount () {
|
||||||
clientUser=$(whoami);
|
|
||||||
serverUser=$1;
|
serverUser=$1;
|
||||||
serverHost=$2;
|
serverHost=$2;
|
||||||
shift 2;
|
shift 2;
|
||||||
args=($@)
|
args=($@)
|
||||||
for ((i=0; i < ${#args[@]}; i=i + 2)); do
|
for ((i=0; i < ${#args[@]}; i=i + 2)); do
|
||||||
sshfs ${serverUser}@${serverHost}:/citadel/${args[$i]}/ /home/${clientUser}/${args[$i + 1]}/ -o reconnect,ServerAliveInterval=15,ServerAliveCountMax=8
|
sshfs ${serverUser}@${serverHost}:/citadel/${args[$i]}/ $HOME/${args[$i + 1]}/ -o reconnect,ServerAliveInterval=15,ServerAliveCountMax=8
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ set -euo pipefail
|
|||||||
dir="$(pwd)"
|
dir="$(pwd)"
|
||||||
dest=${dir%/*}/${dir##*/}_reencode
|
dest=${dir%/*}/${dir##*/}_reencode
|
||||||
if [[ !(-d $dest) ]]; then
|
if [[ !(-d $dest) ]]; then
|
||||||
mkdir $dest
|
mkdir "$dest"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for file in ./*.$1; do
|
for file in ./*.$1; do
|
||||||
|
@ -21,7 +21,7 @@ fi
|
|||||||
dir="$(pwd)"
|
dir="$(pwd)"
|
||||||
dest=${dir%/*}/${dir##*/}_reencode
|
dest=${dir%/*}/${dir##*/}_reencode
|
||||||
if [[ !(-d $dest) ]]; then
|
if [[ !(-d $dest) ]]; then
|
||||||
mkdir $dest
|
mkdir "$dest"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for file in ./*.m4a; do
|
for file in ./*.m4a; do
|
||||||
|
25
scripts/transcode_flac.sh
Executable file
25
scripts/transcode_flac.sh
Executable file
@ -0,0 +1,25 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# evaluate options through given arguments
|
||||||
|
file_suffix='wav'
|
||||||
|
map=
|
||||||
|
while [[ $# > 0 ]]; do
|
||||||
|
case $1 in
|
||||||
|
-t | --type) file_suffix=$2; shift 2;;
|
||||||
|
-map ) map='-map 0:0'; shift;;
|
||||||
|
* ) break ;; # Anything else stops command line processing.
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# ensure existence of destination folder
|
||||||
|
dir="$(pwd)"
|
||||||
|
dest=${dir%/*}/${dir##*/}_flac
|
||||||
|
if [[ !(-d $dest) ]]; then
|
||||||
|
mkdir "$dest"
|
||||||
|
fi
|
||||||
|
|
||||||
|
for file in ./*.$file_suffix; do
|
||||||
|
echo "ffmpeg -i '$file' -c:a flac $map '$dest/${file%$file_suffix}flac'";
|
||||||
|
ffmpeg -i "$file" -c:a flac $map "$dest/${file%$file_suffix}flac";
|
||||||
|
done
|
@ -16,7 +16,7 @@ done
|
|||||||
dir="$(pwd)"
|
dir="$(pwd)"
|
||||||
dest=${dir%/*}/${dir##*/}_ogg
|
dest=${dir%/*}/${dir##*/}_ogg
|
||||||
if [[ !(-d $dest) ]]; then
|
if [[ !(-d $dest) ]]; then
|
||||||
mkdir $dest
|
mkdir "$dest"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for file in ./*.$file_suffix; do
|
for file in ./*.$file_suffix; do
|
||||||
|
Loading…
Reference in New Issue
Block a user