# HG changeset patch # User František Kučera # Date 1555876666 -7200 # Node ID 1e1ba6753d9252c5eb2cf87810a1dfa9707601b4 # Parent a0b7d78460c297817ec0353c8af67cd41b31dfc3 reports: use printRecfileKeyValue also for headers diff -r a0b7d78460c2 -r 1e1ba6753d92 vcs-backup.sh --- a/vcs-backup.sh Sun Apr 21 21:49:50 2019 +0200 +++ b/vcs-backup.sh Sun Apr 21 21:57:46 2019 +0200 @@ -32,6 +32,8 @@ # This is an asynchronous message-driven shell script that runs distributed across two machines and four user accounts. You have been warned :-) + + # Server-side configuration: VCS_BACKUP_DATA_DIR="/mnt/data"; VCS_BACKUP_CURRENT_DIR="$VCS_BACKUP_DATA_DIR/current"; @@ -204,9 +206,9 @@ # Environment: server # User: $VCS_BACKUP_MANAGER vcs_backup_public_serverListRepositories() { - echo "%rec: repositories"; - echo "%type: bytes int"; - echo "%type: public bool"; + printRecfileKeyValue "%rec" "repositories"; + printRecfileKeyValue "%type" "bytes int"; + printRecfileKeyValue "%type" "public bool"; echo; find "$VCS_BACKUP_CONFIG_DIR" -name url.txt -printf '%P\n' | sort | xargs dirname | while read d; do @@ -235,11 +237,11 @@ # User: $VCS_BACKUP_USER # should be called from cron (usually every day) vcs_backup_public_serverPullCronTask() { - echo "%rec: pull"; - echo "%type: started date"; - echo "%type: finished date"; - echo "%type: duration int"; - echo "%type: resultCode int"; + printRecfileKeyValue "%rec" "pull"; + printRecfileKeyValue "%type" "started date"; + printRecfileKeyValue "%type" "finished date"; + printRecfileKeyValue "%type" "duration int"; + printRecfileKeyValue "%type" "resultCode int"; find "$VCS_BACKUP_CONFIG_DIR" -name url.txt -printf '%P\n' | sort | xargs dirname | while read d; do state=$(cat "$VCS_BACKUP_CONFIG_DIR/$d/state.txt");