Compare commits
No commits in common. "bf419bfd989bad9d16af1c80c92f27df7f04fe58" and "8dd5e34e4d03ae92a4c4c7fcc57f241387c064aa" have entirely different histories.
bf419bfd98
...
8dd5e34e4d
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,3 @@
|
||||
/backup
|
||||
/home_internal
|
||||
/root_internal
|
||||
output.txt
|
||||
|
@ -204,7 +204,7 @@ ex ()
|
||||
}
|
||||
|
||||
# BEGIN_KITTY_SHELL_INTEGRATION
|
||||
if [[ -n "$KITTY_INSTALLATION_DIR" && -e "$KITTY_INSTALLATION_DIR/shell-integration/bash/kitty.bash" ]]; then
|
||||
if [[ -n "$KITTY_INSTALLATION_DIR" -a -e "$KITTY_INSTALLATION_DIR/shell-integration/bash/kitty.bash" ]]; then
|
||||
source "$KITTY_INSTALLATION_DIR/shell-integration/bash/kitty.bash";
|
||||
fi
|
||||
# END_KITTY_SHELL_INTEGRATION
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,65 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
shopt -s expand_aliases
|
||||
source /sync/home_internal/.bash_aliases # FSCLEANUP -> zum besseren testen
|
||||
# source /sync/home_external/.bash_aliases
|
||||
|
||||
|
||||
sync () {
|
||||
dry_run=false
|
||||
home_or_root=
|
||||
update=true
|
||||
in_to_ex=
|
||||
while [[ $# > 0 ]]; do
|
||||
case $1 in
|
||||
-d | --dry ) dry_run=true; shift;;
|
||||
-c | --checksum ) update=false; shift;;
|
||||
--in-to-ex ) in_to_ex=true; shift;;
|
||||
--ex-to-in ) in_to_ex=false; shift;;
|
||||
--dir ) home_or_root=$2; shift 2;;
|
||||
* ) break ;; # Anything else stops command line processing.
|
||||
esac
|
||||
done
|
||||
|
||||
dir_external=/sync/${home_or_root}_external/
|
||||
dir_internal=/sync/${home_or_root}_internal/
|
||||
# dry-run
|
||||
if [[ "$dry_run" == true ]]; then
|
||||
ex_to_in=
|
||||
in_to_ex=
|
||||
update_or_default=
|
||||
if [[ "$update" == true ]]; then
|
||||
update_or_default='UPDATE'
|
||||
ex_to_in=$(rsync_update $dir_external $dir_internal --dry-run)
|
||||
in_to_ex=$(rsync_update $dir_internal $dir_external --dry-run)
|
||||
else
|
||||
update_or_default='DEFAULT'
|
||||
ex_to_in=$(rsync_default $dir_external $dir_internal --dry-run)
|
||||
in_to_ex=$(rsync_default $dir_internal $dir_external --dry-run)
|
||||
fi
|
||||
# use printf for displaying \n as newline correctly
|
||||
printf "RSYNC ${update_or_default}: external -> internal:\n\n$ex_to_in\n\nRSYNC ${update_or_default}: internal -> external:\n\n$in_to_ex\n"
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
# real deal
|
||||
if [[ -z "$in_to_ex" ]]; then
|
||||
echo "Error. No sync direction given."
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
if [[ "$update" == true ]]; then
|
||||
if [[ "$in_to_ex" == true ]]; then
|
||||
rsync_update $dir_internal $dir_external
|
||||
else
|
||||
rsync_update $dir_external $dir_internal
|
||||
fi
|
||||
exit 0;
|
||||
fi
|
||||
if [[ "$in_to_ex" == true ]]; then
|
||||
rsync_default $dir_internal $dir_external
|
||||
else
|
||||
rsync_default $dir_external $dir_internal
|
||||
fi
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
source /sync/scripts/sync_general.sh
|
||||
|
||||
sync --dir home $@
|
@ -1,6 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
source /sync/scripts/sync_general.sh
|
||||
|
||||
sync --dir root $@
|
Loading…
Reference in New Issue
Block a user