Skip to content

Commit 5c20f7c

Browse files
committed
refactor(remote-backup.sh): rewrite the long commands to a compact form.
No functional changes.
1 parent f117cf2 commit 5c20f7c

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

vagrant/provisioning/roles/mystamps-backup/templates/remote-backup.sh

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,12 @@ DUPLICITY_CMD='duplicity --no-compression'
1010

1111
case "${1:-}" in
1212
'uploads')
13-
su \
14-
mystamps \
15-
-c "${DUPLICITY_CMD} --name=uploads --no-encryption /data/uploads ${UPLOADS_DST}" \
16-
2>&1
13+
su mystamps 2>&1 \
14+
-c "${DUPLICITY_CMD} --name=uploads --no-encryption /data/uploads ${UPLOADS_DST}"
1715
;;
1816
'mysql-backups')
19-
PASSPHRASE="$PASSPHRASE" su \
20-
mystamps \
21-
-c "${DUPLICITY_CMD} --name=mysql-backups /data/backups ${MYSQL_BACKUPS_DST}" \
22-
2>&1
17+
PASSPHRASE="$PASSPHRASE" su mystamps 2>&1 \
18+
-c "${DUPLICITY_CMD} --name=mysql-backups /data/backups ${MYSQL_BACKUPS_DST}"
2319
;;
2420
*)
2521
echo 2>&1 "Usage: $(dirname "$0") (uploads|mysql-backups)"

0 commit comments

Comments
 (0)