Skip to content

Commit 48259fd

Browse files
Copilotdjeada
andauthored
[WIP] Fix rsync hanging issue by adding progress output (#37)
* Initial plan * Add rsync progress, new excludes, and log messages to firefox_profile_usb.sh Agent-Logs-Url: https://github.com/djeada/Bash-Scripts/sessions/eece4f1c-b23f-4f34-ab9f-c7738c7d3cc2 Co-authored-by: djeada <37275728+djeada@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: djeada <37275728+djeada@users.noreply.github.com>
1 parent 1095925 commit 48259fd

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

src/firefox_profile_usb.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,8 @@ backup_mode() {
427427
printf 'IDX\tNAME\tDEFAULT\tSRC_IS_REL\tSRC_PATH\tBACKUP_DIR\n'
428428
} > "$metadata_file"
429429

430+
log "Copying profiles to USB (this may take several minutes for large profiles)..."
431+
430432
for (( i=0; i<${#PROFILE_RESOLVED[@]}; i++ )); do
431433
name="${PROFILE_NAMES[$i]}"
432434
path="${PROFILE_PATHS_RAW[$i]}"
@@ -446,7 +448,7 @@ backup_mode() {
446448
log "Backing up profile '$name' from $resolved"
447449
mkdir -p "$dest_profile_dir"
448450

449-
rsync -aH --delete \
451+
rsync -aH --delete --info=progress2 \
450452
--exclude='lock' \
451453
--exclude='.parentlock' \
452454
--exclude='*.sqlite-wal' \
@@ -455,6 +457,11 @@ backup_mode() {
455457
--exclude='startupCache/' \
456458
--exclude='crashes/' \
457459
--exclude='minidumps/' \
460+
--exclude='storage/' \
461+
--exclude='thumbnails/' \
462+
--exclude='datareporting/' \
463+
--exclude='healthreport/' \
464+
--exclude='storage.sqlite' \
458465
"$resolved/" "$dest_profile_dir/"
459466

460467
validate_profile_integrity "$dest_profile_dir" "$name"
@@ -575,6 +582,8 @@ restore_mode() {
575582
printf 'IDX\tNAME\tDEFAULT\tSRC_IS_REL\tSRC_PATH\tBACKUP_DIR\tRESTORED_BASENAME\n'
576583
} > "$temp_metadata"
577584

585+
log "Restoring profiles from USB (this may take several minutes for large profiles)..."
586+
578587
while IFS=$'\t' read -r idx name default src_is_rel src_path backup_dir; do
579588
[[ "$idx" == "IDX" ]] && continue
580589

@@ -595,7 +604,7 @@ restore_mode() {
595604
mkdir -p "$dest_profile_dir"
596605

597606
log "Restoring profile '$name' to $dest_profile_dir"
598-
rsync -aH --delete "$src_profile_dir/" "$dest_profile_dir/"
607+
rsync -aH --delete --info=progress2 "$src_profile_dir/" "$dest_profile_dir/"
599608

600609
clean_restored_profile "$dest_profile_dir"
601610
validate_profile_integrity "$dest_profile_dir" "$name"

0 commit comments

Comments
 (0)