Help Creating Bat File to Sync Local Files to Crypt and Backup Drives

What is the problem you are having with rclone?

I recently found out about the crypt config and thought it would be a good idea to encrypt the files before my nightly sync to Google Drive happens. I managed to follow a guide I found to create the config needed for crypt and then mount the drive.

I have three Google Drive accounts setup on rClone, one primary and two backups. How would a bat file look like to do the following:

  1. Mount crypt drive
  2. Sync local files to the crypt folder on primary
  3. Unmount crypt drive
  4. Sync primary to 2nd Google Drive
  5. Sync primary to 3rd Google Drive

I plan to run this every night with Task Scheduler.

What is your rclone version (output from rclone version)

1.57

Which cloud storage system are you using? (eg Google Drive)

Google Drive

hello,

i can provide the answers to all those questions.

when you posted there was a template of questions.
please help us to help you and answer all the questions.

Sure, here are my responses to the remaining questions. I wasn't sure if they were needed.

The command you were trying to run (eg rclone copy /tmp remote:tmp)

This is what I'm currently using to mount:

@echo off
cd C:\Users\Administrator\Documents\rclone
rclone mount --vfs-cache-mode full gcrypt:/ x:
exit

This is a seperate bat file to copy/sync:

@echo off
cd C:\Users\Administrator\Documents\rclone
rclone copy E:\SFTP\Files X:\Files
rclone sync Drive1: Drive2:
rclone sync Drive1: Drive3:
exit

The rclone config contents with secrets removed.

[Drive1]
type = drive
client_id = *
client_secret = *
scope = drive
root_folder_id =
token = *

[Drive2]
type = drive
client_id = *
client_secret = *
scope = drive
root_folder_id =
token = *
team_drive = *

[Drive3]
type = drive
client_id = *
client_secret = *
scope = drive
root_folder_id =
token = *
team_drive = *

[gcrypt]
type = crypt
remote = Drive1:encrypted
password = *
password2 = *

A log from the command with the -vv flag

N/A - I don't have a problem with the commands I'm using, however I would like to somehow tie them all together in the steps mentioned in my initial post.

ok,

have you every created a task using task scheduler?

best to test using a very simple rclone command.
make sure to test if from the command line first.

this will make sure the rclone.exe can be run and rclone can find the config file.

if the command works, then there should be two files.

  • log.txt
  • ls.txt
@echo off
cd C:\Users\Administrator\Documents\rclone
rclone listremotes --log-level=DEBUG --log-file=log.txt > ls.txt

Yes, I've created a task with Task Scheduler for the copy/sync bat file, before that I tested it from the command line.

log.txt:

2021/11/14 17:47:52 DEBUG : rclone: Version "v1.57.0" starting with parameters ["rclone" "listremotes" "--log-level=DEBUG" "--log-file=log.txt"]
2021/11/14 17:47:52 DEBUG : Using config file from "C:\\Users\\Administrator\\AppData\\Roaming\\rclone\\rclone.conf"
2021/11/14 17:47:52 DEBUG : rclone: Version "v1.57.0" finishing with parameters ["rclone" "listremotes" "--log-level=DEBUG" "--log-file=log.txt"]

ls.txt:

Drive1:
Drive2:
Drive3:
gcrypt:

is that log output from the command line or from running the task?

That was the output from running:
rclone listremotes --log-level=DEBUG --log-file=log.txt > ls.txt

that output, was it from

  • running that command on the command line
    or
  • running that command via task scheduler

Hi,

Sorry for the late reply, I didn't get the notification and I forgot to check.

To answer the question, it was from running the command on the command line.

ok, remind me, at this point, what do you need help with?

Essentially, I would like a bat file that could do the following:

Mount crypt drive
Sync local files to the crypt folder on primary
Unmount crypt drive
Sync primary to 2nd Google Drive
Sync primary to 3rd Google Drive

I had two separate bat files that kind of did what I wanted as listed in one of my previous posts, but without the unmounting part. Also after checking recently, I noticed that the mounting command didn't work anymore. I was getting an I/O error.

post them

no idea what that exactly means?
post a rclone debug log and other relevant details