1
0
Fork 0
mirror of https://github.com/SinTan1729/random.git synced 2025-04-04 10:28:04 -05:00

chg: Logfile location

This commit is contained in:
Sayantan Santra 2025-03-21 15:30:15 -05:00
parent 2b22d46507
commit 4e8ad8caf1
Signed by: SinTan1729
GPG key ID: 0538DD402EA50898
2 changed files with 132 additions and 129 deletions

View file

@ -22,73 +22,74 @@ set -e
HMDIR="/home/sintan"
BKDIR_SSD="server-rsync:/home/sintan"
BKDIR_HDD="server-rsync:/mnt/storage"
LGDIR="/home/sintan"
mkdir -p "/home/sintan/TempStorage/impfilesbk-logs/"
LGFILE="/home/sintan/TempStorage/impfilesbk-logs/$(date -Idate).log"
echo "--------------------------------------------------" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
echo "--------------------------------------------------" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
echo "--------------------------------------------------" | tee -a "$LGFILE"
echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" | tee -a "$LGFILE"
echo "--------------------------------------------------" | tee -a "$LGFILE"
echo $(date) "| Backing up Code..." | tee -a "$LGDIR/TempStorage/impfilesbk.log"
echo $(date) "| Backing up Code..." | tee -a "$LGFILE"
rsync -aAXH --delete --stats --exclude '**/target/' --exclude 'git/*/lake-packages/' \
--exclude 'git/*/build/' "$HMDIR/Code/" "$BKDIR_HDD/Code/" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
echo $'\n'$(date) "| Done!" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
--exclude 'git/*/build/' "$HMDIR/Code/" "$BKDIR_HDD/Code/" | tee -a "$LGFILE"
echo $'\n'$(date) "| Done!" | tee -a "$LGFILE"
echo "--------------------------------------------------" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
echo "--------------------------------------------------" | tee -a "$LGFILE"
echo $(date) "| Backing up Pictures..." | tee -a "$LGDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/Pictures/" "$BKDIR_SSD/Pictures/" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
echo $'\n'$(date) "| Done!" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
echo $(date) "| Backing up Pictures..." | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/Pictures/" "$BKDIR_SSD/Pictures/" | tee -a "$LGFILE"
echo $'\n'$(date) "| Done!" | tee -a "$LGFILE"
echo "--------------------------------------------------" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
echo "--------------------------------------------------" | tee -a "$LGFILE"
echo $(date) "| Backing up Videos..." | tee -a "$LGDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/Videos/" "$BKDIR_SSD/Videos/" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
echo $'\n'$(date) "| Done!" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
echo $(date) "| Backing up Videos..." | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/Videos/" "$BKDIR_SSD/Videos/" | tee -a "$LGFILE"
echo $'\n'$(date) "| Done!" | tee -a "$LGFILE"
echo "--------------------------------------------------" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
echo "--------------------------------------------------" | tee -a "$LGFILE"
echo $(date) "| Backing up Zotero..." | tee -a "$LGDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/Zotero/" "$BKDIR_HDD/Zotero/" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
echo $'\n'$(date) "| Done!" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
echo $(date) "| Backing up Zotero..." | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/Zotero/" "$BKDIR_HDD/Zotero/" | tee -a "$LGFILE"
echo $'\n'$(date) "| Done!" | tee -a "$LGFILE"
echo "--------------------------------------------------" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
echo "--------------------------------------------------" | tee -a "$LGFILE"
echo $(date) "| Backing up some dotfiles..." | tee -a "$LGDIR/TempStorage/impfilesbk.log"
echo $(date) "| Backing up some dotfiles..." | tee -a "$LGFILE"
rsync -aAXH --delete --stats --quiet --no-links --exclude={'*cache*','*Cache*','*autosave*','Signal','chromium','Code','Code - OSS','discord','vivaldi','Ferdium/Partitions'} \
--delete-excluded "$HMDIR/.config/" "$BKDIR_HDD/dotfiles/laptop/[dot]config/" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/.profile" "$BKDIR_HDD/dotfiles/laptop/[dot]profile" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/.bashrc" "$BKDIR_HDD/dotfiles/laptop/[dot]bashrc" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/.Xresources" "$BKDIR_HDD/dotfiles/laptop/[dot]Xresources" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/.local/bin/personal/" "$BKDIR_HDD/dotfiles/laptop/[dot]local_bin_personal/" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/.ssh/" "$BKDIR_HDD/dotfiles/laptop/[dot]ssh/" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
echo $'\n'$(date) "| Done!" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
--delete-excluded "$HMDIR/.config/" "$BKDIR_HDD/dotfiles/laptop/[dot]config/" | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/.profile" "$BKDIR_HDD/dotfiles/laptop/[dot]profile" | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/.bashrc" "$BKDIR_HDD/dotfiles/laptop/[dot]bashrc" | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/.Xresources" "$BKDIR_HDD/dotfiles/laptop/[dot]Xresources" | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/.local/bin/personal/" "$BKDIR_HDD/dotfiles/laptop/[dot]local_bin_personal/" | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/.ssh/" "$BKDIR_HDD/dotfiles/laptop/[dot]ssh/" | tee -a "$LGFILE"
echo $'\n'$(date) "| Done!" | tee -a "$LGFILE"
echo "--------------------------------------------------" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
echo "--------------------------------------------------" | tee -a "$LGFILE"
echo $(date) "| Pulling pkglists_server from server..." | tee -a "$LGDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$BKDIR_HDD/Documents/Backup/pkglists/server/" "$HMDIR/Documents/Backup/pkglists/server/" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
echo $'\n'$(date) "| Done!" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
echo $(date) "| Pulling pkglists_server from server..." | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$BKDIR_HDD/Documents/Backup/pkglists/server/" "$HMDIR/Documents/Backup/pkglists/server/" | tee -a "$LGFILE"
echo $'\n'$(date) "| Done!" | tee -a "$LGFILE"
echo "--------------------------------------------------" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
echo "--------------------------------------------------" | tee -a "$LGFILE"
echo $(date) "| Backing up Documents..." | tee -a "$LGDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/Documents/" "$BKDIR_HDD/Documents/" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
echo $'\n'$(date) "| Done!" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
echo $(date) "| Backing up Documents..." | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/Documents/" "$BKDIR_HDD/Documents/" | tee -a "$LGFILE"
echo $'\n'$(date) "| Done!" | tee -a "$LGFILE"
echo "--------------------------------------------------" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
echo "--------------------------------------------------" | tee -a "$LGFILE"
echo $(date) "| Pulling Programs from server..." | tee -a "$LGDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$BKDIR_HDD/Programs/" "$HMDIR/Programs/" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
echo $'\n'$(date) "| Done!" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
echo $(date) "| Pulling Programs from server..." | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$BKDIR_HDD/Programs/" "$HMDIR/Programs/" | tee -a "$LGFILE"
echo $'\n'$(date) "| Done!" | tee -a "$LGFILE"
echo "--------------------------------------------------" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
echo "--------------------------------------------------" | tee -a "$LGFILE"
echo $(date) "| Pulling Music from server..." | tee -a "$LGDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$BKDIR_HDD/Music/" "$HMDIR/Music/" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
echo $'\n'$(date) "| Done!" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
echo $(date) "| Pulling Music from server..." | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$BKDIR_HDD/Music/" "$HMDIR/Music/" | tee -a "$LGFILE"
echo $'\n'$(date) "| Done!" | tee -a "$LGFILE"
echo "--------------------------------------------------" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
echo "--------------------------------------------------" | tee -a "$LGFILE"
echo $'\n'"--------------------------------------------------" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
echo "--------------------------------------------------" | tee -a "$LGDIR/TempStorage/impfilesbk.log"
echo $'\n'"--------------------------------------------------" | tee -a "$LGFILE"
echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" | tee -a "$LGFILE"
echo "--------------------------------------------------" | tee -a "$LGFILE"

View file

@ -17,120 +17,122 @@ set -e
# Setup location for home and backup directory
HMDIR="/home/sintan"
BKDIR="/mnt/storage"
mkdir -p "/home/sintan/TempStorage/impfilesbk-logs/"
LGFILE="/home/sintan/TempStorage/impfilesbk-logs/$(date -Idate).log"
echo $(date) "| Backing up PhotoPrism index..." | tee -a "$BKDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/Docker/photoprism/storage/index-backup.sql" "$BKDIR/Programs/Docker/PhotoPrism/index-backup-"$(date +%A)".sql" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo $'\n'$(date) "| Done!" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo $(date) "| Backing up PhotoPrism index..." | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/Docker/photoprism/storage/index-backup.sql" "$BKDIR/Programs/Docker/PhotoPrism/index-backup-"$(date +%A)".sql" | tee -a "$LGFILE"
echo $'\n'$(date) "| Done!" | tee -a "$LGFILE"
echo "--------------------------------------------------" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo "--------------------------------------------------" | tee -a "$LGFILE"
echo $(date) "| Backing up arr index..." | tee -a "$BKDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/Docker/arr/config_sonarr/Backups/" "$BKDIR/Programs/Docker/arr-backups/sonarr/" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/Docker/arr/config_prowlarr/Backups/" "$BKDIR/Programs/Docker/arr-backups/prowlarr/" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo $'\n'$(date) "| Done!" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo $(date) "| Backing up arr index..." | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/Docker/arr/config_sonarr/Backups/" "$BKDIR/Programs/Docker/arr-backups/sonarr/" | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/Docker/arr/config_prowlarr/Backups/" "$BKDIR/Programs/Docker/arr-backups/prowlarr/" | tee -a "$LGFILE"
echo $'\n'$(date) "| Done!" | tee -a "$LGFILE"
echo "--------------------------------------------------" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo "--------------------------------------------------" | tee -a "$LGFILE"
echo $(date) "| Backing up qBittorrent config..." | tee -a "$BKDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/Docker/qbt/qbt-config/" "$BKDIR/Programs/Docker/qBittorrent-config/" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/Docker/qbt-private/qbt-config/" "$BKDIR/Programs/Docker/qBittorrent2-config/" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo $'\n'$(date) "| Done!" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo $(date) "| Backing up qBittorrent config..." | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/Docker/qbt/qbt-config/" "$BKDIR/Programs/Docker/qBittorrent-config/" | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/Docker/qbt-private/qbt-config/" "$BKDIR/Programs/Docker/qBittorrent2-config/" | tee -a "$LGFILE"
echo $'\n'$(date) "| Done!" | tee -a "$LGFILE"
echo "--------------------------------------------------" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo "--------------------------------------------------" | tee -a "$LGFILE"
echo $(date) "| Backing up Caddyfiles..." | tee -a "$BKDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/Docker/caddy/Caddyfiles/" "$BKDIR/Programs/Docker/Caddyfiles/" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo $'\n'$(date) "| Done!" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo $(date) "| Backing up Caddyfiles..." | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/Docker/caddy/Caddyfiles/" "$BKDIR/Programs/Docker/Caddyfiles/" | tee -a "$LGFILE"
echo $'\n'$(date) "| Done!" | tee -a "$LGFILE"
echo "--------------------------------------------------" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo "--------------------------------------------------" | tee -a "$LGFILE"
echo $(date) "| Backing up cloudfalred config..." | tee -a "$BKDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/Docker/cloudflared/config/" "$BKDIR/Programs/Docker/cloudflared-config/" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo $'\n'$(date) "| Done!" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo $(date) "| Backing up cloudfalred config..." | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/Docker/cloudflared/config/" "$BKDIR/Programs/Docker/cloudflared-config/" | tee -a "$LGFILE"
echo $'\n'$(date) "| Done!" | tee -a "$LGFILE"
echo $(date) "| Backing up gpodder2go config..." | tee -a "$BKDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/Docker/gpodder/data/" "$BKDIR/Programs/Docker/gpodder2go-data/" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo $'\n'$(date) "| Done!" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo $(date) "| Backing up gpodder2go config..." | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/Docker/gpodder/data/" "$BKDIR/Programs/Docker/gpodder2go-data/" | tee -a "$LGFILE"
echo $'\n'$(date) "| Done!" | tee -a "$LGFILE"
echo "--------------------------------------------------" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo "--------------------------------------------------" | tee -a "$LGFILE"
echo $(date) "| Backing up Navidrome db..." | tee -a "$BKDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/Docker/navidrome/data/navidrome.db" "$BKDIR/Programs/Docker/navidrome.db" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo $'\n'$(date) "| Done!" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo $(date) "| Backing up Navidrome db..." | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/Docker/navidrome/data/navidrome.db" "$BKDIR/Programs/Docker/navidrome.db" | tee -a "$LGFILE"
echo $'\n'$(date) "| Done!" | tee -a "$LGFILE"
echo "--------------------------------------------------" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo "--------------------------------------------------" | tee -a "$LGFILE"
echo $(date) "| Backing up Jellyfin config..." | tee -a "$BKDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/Docker/jellyfin/config/" "$BKDIR/Programs/Docker/jellyfin-config/" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo $'\n'$(date) "| Done!" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo $(date) "| Backing up Jellyfin config..." | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/Docker/jellyfin/config/" "$BKDIR/Programs/Docker/jellyfin-config/" | tee -a "$LGFILE"
echo $'\n'$(date) "| Done!" | tee -a "$LGFILE"
echo "--------------------------------------------------" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo "--------------------------------------------------" | tee -a "$LGFILE"
echo $(date) "| Backing up Forgejo data..." | tee -a "$BKDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/Docker/forgejo/forgejo-data" "$HMDIR/Docker/forgejo/postgres-data" "$BKDIR/Programs/Docker/forgejo-config/" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo $'\n'$(date) "| Done!" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo $(date) "| Backing up Forgejo data..." | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/Docker/forgejo/forgejo-data" "$HMDIR/Docker/forgejo/postgres-data" "$BKDIR/Programs/Docker/forgejo-config/" | tee -a "$LGFILE"
echo $'\n'$(date) "| Done!" | tee -a "$LGFILE"
echo "--------------------------------------------------" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo "--------------------------------------------------" | tee -a "$LGFILE"
echo $(date) "| Backing up Chhoto URL data..." | tee -a "$BKDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "vps-rsync:/home/admin/docker/chhoto-url/" "$BKDIR/Programs/Docker/chhoto-url/" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo $'\n'$(date) "| Done!" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo $(date) "| Backing up Chhoto URL data..." | tee -a "$LGFILE"
rsync -aAXH --delete --stats "vps-rsync:/home/admin/docker/chhoto-url/" "$BKDIR/Programs/Docker/chhoto-url/" | tee -a "$LGFILE"
echo $'\n'$(date) "| Done!" | tee -a "$LGFILE"
echo "--------------------------------------------------" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo "--------------------------------------------------" | tee -a "$LGFILE"
echo $(date) "| Backing up Docker compose files..." | tee -a "$BKDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats --prune-empty-dirs -f '- /*/*/' "$HMDIR/Docker/" "$BKDIR/Programs/Docker/DockerCompose/" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo $'\n'$(date) "| Done!" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo $(date) "| Backing up Docker compose files..." | tee -a "$LGFILE"
rsync -aAXH --delete --stats --prune-empty-dirs -f '- /*/*/' "$HMDIR/Docker/" "$BKDIR/Programs/Docker/DockerCompose/" | tee -a "$LGFILE"
echo $'\n'$(date) "| Done!" | tee -a "$LGFILE"
echo "--------------------------------------------------" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo "--------------------------------------------------" | tee -a "$LGFILE"
echo $(date) "| Backing up Pictures..." | tee -a "$BKDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/Pictures/" "$BKDIR/Pictures/" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/TempStorage/DCIM/" "$BKDIR/TempStorage/DCIM/" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo $'\n'$(date) "| Done!" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo $(date) "| Backing up Pictures..." | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/Pictures/" "$BKDIR/Pictures/" | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/TempStorage/DCIM/" "$BKDIR/TempStorage/DCIM/" | tee -a "$LGFILE"
echo $'\n'$(date) "| Done!" | tee -a "$LGFILE"
echo "--------------------------------------------------" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo "--------------------------------------------------" | tee -a "$LGFILE"
echo $(date) "| Backing up Videos..." | tee -a "$BKDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats --prune-empty-dirs -f '- /*/*/' "$HMDIR/Videos/" "$BKDIR/Videos/" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo $'\n'$(date) "| Done!" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo $(date) "| Backing up Videos..." | tee -a "$LGFILE"
rsync -aAXH --delete --stats --prune-empty-dirs -f '- /*/*/' "$HMDIR/Videos/" "$BKDIR/Videos/" | tee -a "$LGFILE"
echo $'\n'$(date) "| Done!" | tee -a "$LGFILE"
echo "--------------------------------------------------" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo "--------------------------------------------------" | tee -a "$LGFILE"
echo $(date) "| Backing up some dotfiles..." | tee -a "$BKDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats --quiet --no-links --exclude={'*cache*','*Cache*'} --delete-excluded "$HMDIR/.config/" "$BKDIR/dotfiles/server/[dot]config/" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/.bash_profile" "$BKDIR/dotfiles/server/[dot]bash_profile" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/.bashrc" "$BKDIR/dotfiles/server/[dot]bashrc" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
# rsync -aAXH --delete --stats "$HMDIR/.Xresources" "$BKDIR/dotfiles/server/[dot]Xresources" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
# rsync -aAXH --delete --stats "$BKDIR/dotfiles/[dot]local_bin_personal/" "$HMDIR/.local/bin/personal/" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/.ssh/" "$BKDIR/dotfiles/server/[dot]ssh/" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo $'\n'$(date) "| Done!" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo $(date) "| Backing up some dotfiles..." | tee -a "$LGFILE"
rsync -aAXH --delete --stats --quiet --no-links --exclude={'*cache*','*Cache*'} --delete-excluded "$HMDIR/.config/" "$BKDIR/dotfiles/server/[dot]config/" | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/.bash_profile" "$BKDIR/dotfiles/server/[dot]bash_profile" | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/.bashrc" "$BKDIR/dotfiles/server/[dot]bashrc" | tee -a "$LGFILE"
# rsync -aAXH --delete --stats "$HMDIR/.Xresources" "$BKDIR/dotfiles/server/[dot]Xresources" | tee -a "$LGFILE"
# rsync -aAXH --delete --stats "$BKDIR/dotfiles/[dot]local_bin_personal/" "$HMDIR/.local/bin/personal/" | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/.ssh/" "$BKDIR/dotfiles/server/[dot]ssh/" | tee -a "$LGFILE"
echo $'\n'$(date) "| Done!" | tee -a "$LGFILE"
echo "--------------------------------------------------" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo "--- Now backing up to the DAS ---" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo "--------------------------------------------------" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo "--------------------------------------------------" | tee -a "$LGFILE"
echo "--- Now backing up to the DAS ---" | tee -a "$LGFILE"
echo "--------------------------------------------------" | tee -a "$LGFILE"
HMDIR=/mnt/storage
BKDIR_P=/tank1/personal
BKDIR_M=/tank1/media
rsync -aAXH --delete --stats "$HMDIR/Pictures/" "$BKDIR_P/Pictures/" | tee -a "$HMDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/Videos/" "$BKDIR_P/Videos/" | tee -a "$HMDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/Academics/" "$BKDIR_P/Academics/" | tee -a "$HMDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/Zotero/" "$BKDIR_P/Zotero/" | tee -a "$HMDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/Documents/" "$BKDIR_P/Documents/" | tee -a "$HMDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/Code/" "$BKDIR_P/Code/" | tee -a "$HMDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/TempStorage/DCIM/" "$BKDIR_P/TempStorage/DCIM/" | tee -a "$HMDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/TempStorage/MobileSS/" "$BKDIR_P/TempStorage/MobileSS/" | tee -a "$HMDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/TempStorage/.cache/" "$BKDIR_M/TempStorage/.cache/" | tee -a "$HMDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/Programs/" "$BKDIR_P/Programs/" | tee -a "$HMDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/dotfiles/" "$BKDIR_P/dotfiles/" | tee -a "$HMDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/Music/" "$BKDIR_M/Music/" | tee -a "$HMDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/Movies/" "$BKDIR_M/Movies/Main/" | tee -a "$HMDIR/TempStorage/impfilesbk.log"
rsync -aAXH --delete --stats "$HMDIR/Pictures/" "$BKDIR_P/Pictures/" | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/Videos/" "$BKDIR_P/Videos/" | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/Academics/" "$BKDIR_P/Academics/" | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/Zotero/" "$BKDIR_P/Zotero/" | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/Documents/" "$BKDIR_P/Documents/" | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/Code/" "$BKDIR_P/Code/" | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/TempStorage/DCIM/" "$BKDIR_P/TempStorage/DCIM/" | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/TempStorage/MobileSS/" "$BKDIR_P/TempStorage/MobileSS/" | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/TempStorage/.cache/" "$BKDIR_M/TempStorage/.cache/" | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/Programs/" "$BKDIR_P/Programs/" | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/dotfiles/" "$BKDIR_P/dotfiles/" | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/Music/" "$BKDIR_M/Music/" | tee -a "$LGFILE"
rsync -aAXH --delete --stats "$HMDIR/Movies/" "$BKDIR_M/Movies/Main/" | tee -a "$LGFILE"
echo $'\n'"--------------------------------------------------" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo "--------------------------------------------------" | tee -a "$BKDIR/TempStorage/impfilesbk.log"
echo $'\n'"--------------------------------------------------" | tee -a "$LGFILE"
echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" | tee -a "$LGFILE"
echo "--------------------------------------------------" | tee -a "$LGFILE"
# Make the new files visible over samba
# chcon -R -t samba_share_t /mnt/storage/Programs/