-
Notifications
You must be signed in to change notification settings - Fork 7
UAT - rclone based backups and restore #142
Copy link
Copy link
Open
Description
Get it working first
If it makes sense i can se that the main cli can be the entry point that calls rclone
flow for backup:
-
boot to include and unpack rclone.
-
User on server run ```rclone config````
- config is saved in standard OS place
- User updates main config with rclone details:
- $(REMOTE) e.g google_drive_blah
- $(REMOTE_ENDPOINT). e.g
- https://drive.google.com/drive/folders/1f7X6C-SNV0VUSYHazUTJwd1h5or74LSq
- REMOTE_ENDPOINT=1f7X6C-SNV0VUSYHazUTJwd1h5or74LSq
- Main cron does backup and then calls ```rclone sync -i
$(SOURCE_ENDPOINT) $ (REMOTE):$(REMOTE_ENDPOINT)
- $(SOURCE_ENDPOINT) is a file path which main knows.
flow for restore:
from laptop or server:
- User does
rclone listremotes
- see all their backups.
-
User does Rclone "pull" for the backup they want.
-
User does
maincli restore - localfilepath - remote http of main servertold where the pulled back is, and tells main to do it.
_BIN=$(PWD)/_bin
_DATA=$(PWD)/_data
_ETC=$(PWD)/_etc
# https://github.com/rclone/rclone
LIB_NAME=rclone
LIB=github.com/rclone/$(LIB_NAME)
LIB_BIN=$(_BIN)/$(LIB_NAME)
LIB_DATA=$(_DATA)/$(LIB_NAME)
LIB_DATA_TEST=$(PWD)/data_test
LIB_ETC=$(_ETC)/$(LIB_NAME)/rclone.conf
LIB_ETC_GLOBAL=$(HOME)/.config/$(LIB_NAME)/rclone.conf
print:
@echo
@echo LIB: $(LIB)
@echo LIB_BIN: $(LIB_BIN)
@echo LIB_DATA: $(LIB_DATA)
@echo LIB_DATA_TEST: $(LIB_DATA_TEST)
@echo LIB_ETC: $(LIB_ETC)
@echo LIB_ETC: $(LIB_ETC_GLOBAL)
dep:
git clone https://$(LIB)
dep-delete:
build-all: build
build:
cd $(LIB_NAME) && go build -o $(LIB_BIN)
#https://drive.google.com/drive/
REMOTE=gdrive_ubuntusoftware
# https://drive.google.com/drive/folders/1f7X6C-SNV0VUSYHazUTJwd1h5or74LSq
REMOTE_ENDPOINT=1f7X6C-SNV0VUSYHazUTJwd1h5or74LSq
SOURCE_ENDPOINT=$(LIB_DATA_TEST)
run-config-print:
@echo
@echo REMOTE: $(REMOTE)
@echo REMOTE_ENDPOINT: $(REMOTE_ENDPOINT)
@echo SOURCE_ENDPOINT: $(SOURCE_ENDPOINT)
run-config-init:
# works:)
# kicks off the flow to add your gdrive remote
# when you create it call it "gdrive_ubuntusoftware", and choose 3 (Access to files created by rclone only)
$(LIB_BIN) --config $(LIB_ETC) config
run-config-delete:
# works:)
# kicks off the flow to add your gdrive remote
rm -rf $(LIB_ETC)
run-config-open:
# works :)
code $(LIB_ETC)
code $(LIB_ETC_GLOBAL)
#ls $HOME/.config/rclone
run-listremotes:
# works :)
$(LIB_BIN) --config $(LIB_ETC) listremotes
run-ls:
# works :)
# List ALL
$(LIB_BIN) --config $(LIB_ETC) ls $(REMOTE):
run-sync:
# works :)
# syntax: sync -i SOURCE remote:DESTINATION
ls -al $(SOURCE_ENDPOINT)
$(LIB_BIN) --config $(LIB_ETC) sync -i $(SOURCE_ENDPOINT) $(REMOTE):$(REMOTE_ENDPOINT)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels