Skip to content

UAT - rclone based backups and restore #142

@gerardwebb

Description

@gerardwebb

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:

  1. boot to include and unpack rclone.

  2. User on server run ```rclone config````

  • config is saved in standard OS place
  1. User updates main config with rclone details:
  1. 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:

  1. User does rclone listremotes
  • see all their backups.
  1. User does Rclone "pull" for the backup they want.

  2. User does maincli restore - localfilepath - remote http of main server told 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)
	

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions