Add Rclone backup type#51
Conversation
See README.md for documentation.
itzg
left a comment
There was a problem hiding this comment.
Sorry for the delay reviewing this. Just the typo/extra variable I commented about and then this is good to merge.
backup-loop.sh
Outdated
| : "${XDG_CONFIG_HOME:=/config}" # for rclone's base config path | ||
| : "${ONE_SHOT:=false}" | ||
| : "${TZ:=Etc/UTC}" | ||
| : "${RCLONE_REPOSITORY:={DEST_DIR}" |
There was a problem hiding this comment.
Should this be
| : "${RCLONE_REPOSITORY:={DEST_DIR}" | |
| : "${RCLONE_REPOSITORY:=${DEST_DIR}}" |
...however it also looks like that variable is not used or documented.
There was a problem hiding this comment.
Sorry, not very fluent in bash yet. I'm trying to make the RCLONE_REPOSITORY default to /backups, or if the user used the DEST_DIR variable instead of RCLONE_REPOSITORY, then it would still work as they expected.
| command rclone lsf --format "tp" "${RCLONE_REMOTE}:${DEST_DIR}" | grep ${BACKUP_NAME} | awk \ | ||
| -v DESTINATION="${DEST_DIR}" \ |
There was a problem hiding this comment.
...ah, given https://github.com/itzg/docker-mc-backup/pull/51/files#r774779939 it seems like you'll want this to be
| command rclone lsf --format "tp" "${RCLONE_REMOTE}:${DEST_DIR}" | grep ${BACKUP_NAME} | awk \ | |
| -v DESTINATION="${DEST_DIR}" \ | |
| command rclone lsf --format "tp" "${RCLONE_REMOTE}:${RCLONE_REPOSITORY}" | grep ${BACKUP_NAME} | awk \ | |
| -v DESTINATION="${RCLONE_REPOSITORY}" \ |
The way to read ${RCLONE_REPOSITORY:=${DEST_DIR}} is "If RCLONE_REPOSITORY isn't already set, set it to the value of the DEST_DIR variable". And the leading colon on the line is a way to say process the line but don't execute it.
|
Okay, I don't see the point of having that extra variable, not sure why I put it there in the first place. The docs already say just to use |
Totally works 😃 |
|
Are you good with me merging or did you need to do more testing? |
|
Image will get pushed with https://github.com/itzg/docker-mc-backup/actions/runs/1617547149 |
Implemented Rclone as a backup type. This is primarily a derivative of the
tarbackup method but also uses code from #8.See README.md for documentation.