Skip to content

Add Rclone backup type#51

Merged
itzg merged 2 commits intoitzg:masterfrom
cadenkriese:rclone
Dec 24, 2021
Merged

Add Rclone backup type#51
itzg merged 2 commits intoitzg:masterfrom
cadenkriese:rclone

Conversation

@cadenkriese
Copy link
Contributor

Implemented Rclone as a backup type. This is primarily a derivative of the tar backup method but also uses code from #8.

See README.md for documentation.

See README.md for documentation.
Copy link
Owner

@itzg itzg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be

Suggested change
: "${RCLONE_REPOSITORY:={DEST_DIR}"
: "${RCLONE_REPOSITORY:=${DEST_DIR}}"

...however it also looks like that variable is not used or documented.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +304 to +305
command rclone lsf --format "tp" "${RCLONE_REMOTE}:${DEST_DIR}" | grep ${BACKUP_NAME} | awk \
-v DESTINATION="${DEST_DIR}" \
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...ah, given https://github.com/itzg/docker-mc-backup/pull/51/files#r774779939 it seems like you'll want this to be

Suggested change
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.

@cadenkriese
Copy link
Contributor Author

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 DEST_DIR. But thanks for the pointers anyway :)

@itzg
Copy link
Owner

itzg commented Dec 23, 2021

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 DEST_DIR. But thanks for the pointers anyway :)

Totally works 😃

@itzg
Copy link
Owner

itzg commented Dec 23, 2021

Are you good with me merging or did you need to do more testing?

@itzg itzg merged commit dcb8bb3 into itzg:master Dec 24, 2021
@itzg
Copy link
Owner

itzg commented Dec 24, 2021

Image will get pushed with https://github.com/itzg/docker-mc-backup/actions/runs/1617547149

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants