Unable to sync directories via bash script

What is the problem you are having with rclone?

Heya
I've been trying to backup a few files that come from the backup mods of of my minecraft servers.
I wanted to automate these syncs to my drive using a systemd service and a bash script, but every time i run the bash script, it errors out.

Mind you, running the command directly from the shell works perfectly fine

Run the command 'rclone version' and share the full output of the command.

rclone v1.64.2

  • os/version: ubuntu 22.04 (64 bit)
  • os/kernel: 5.15.0-88-generic (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.21.3
  • go/linking: static
  • go/tags: none

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

Google Drive

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

rclone sync -P "home/disruption/FluffCraft/backup" s:MCBackup/FluffCraft

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

[s]
type = drive
client_id = XXX
client_secret = XXX
scope = drive
token = XXX

A log from the command that you were trying to run with the -vv flag

2023-11-01 17:48:08 ERROR : : error reading source directory: directory not found
2023-11-01 17:48:08 ERROR : Google drive root 'MCBackup/FluffCraft': not deleting files as there were IO errors
2023-11-01 17:48:08 ERROR : Google drive root 'MCBackup/FluffCraft': not deleting directories as there were IO errors
2023-11-01 17:48:08 ERROR : Attempt 1/3 failed with 1 errors and: directory not found
2023-11-01 17:48:08 ERROR : : error reading source directory: directory not found
2023-11-01 17:48:08 ERROR : Google drive root 'MCBackup/FluffCraft': not deleting files as there were IO errors
2023-11-01 17:48:08 ERROR : Google drive root 'MCBackup/FluffCraft': not deleting directories as there were IO errors
2023-11-01 17:48:08 ERROR : Attempt 2/3 failed with 1 errors and: directory not found
2023-11-01 17:48:08 ERROR : : error reading source directory: directory not found
2023-11-01 17:48:08 ERROR : Google drive root 'MCBackup/FluffCraft': not deleting files as there were IO errors
2023-11-01 17:48:08 ERROR : Google drive root 'MCBackup/FluffCraft': not deleting directories as there were IO errors
2023-11-01 17:48:08 ERROR : Attempt 3/3 failed with 1 errors and: directory not found
Transferred:             0 / 0 Bytes, -, 0 Bytes/s, ETA -
Errors:                 1 (retrying may help)
Elapsed time:         1.8s
2023/11/01 17:48:08 Failed to sync: directory not found

welcome to the forum,

rclone cannot find the source, perhaps you meant "/home/disruption/FluffCraft/backup"

that is many old.
https://rclone.org/downloads/#script-download-and-install

after updating, if you continue to have problems, need to post a full debug log by using -vv

Updated the post after re-running the commands in the new version (And this time posting the correct)

Output of the command within the script using -vv again

2023/11/01 18:18:08 DEBUG : Creating backend with remote "/home/disruption/FluffCraft/backup"
2023/11/01 18:18:08 DEBUG : Using config file from "/home/disruption/.config/rclone/rclone.conf"
2023/11/01 18:18:08 DEBUG : Creating backend with remote "s:MCBackup/FluffCraft"
2023/11/01 18:18:09 DEBUG : Google drive root 'MCBackup/FluffCraft': 'root_folder_id = 0AN-c_EFFdKKJUk9PVA' - save this in the config to speed up startup
2023/11/01 18:18:10 ERROR : Local file system at /home/disruption/FluffCraft/backup: error reading source root directory: directory not found
2023/11/01 18:18:10 DEBUG : Google drive root 'MCBackup/FluffCraft': Waiting for checks to finish
2023/11/01 18:18:10 DEBUG : Google drive root 'MCBackup/FluffCraft': Waiting for transfers to finish
2023/11/01 18:18:10 ERROR : Google drive root 'MCBackup/FluffCraft': not deleting files as there were IO errors
2023/11/01 18:18:10 ERROR : Google drive root 'MCBackup/FluffCraft': not deleting directories as there were IO errors
2023/11/01 18:18:10 ERROR : Attempt 1/3 failed with 1 errors and: directory not found
2023/11/01 18:18:10 ERROR : Local file system at /home/disruption/FluffCraft/backup: error reading source root directory: directory not found
2023/11/01 18:18:10 DEBUG : Google drive root 'MCBackup/FluffCraft': Waiting for checks to finish
2023/11/01 18:18:10 DEBUG : Google drive root 'MCBackup/FluffCraft': Waiting for transfers to finish
2023/11/01 18:18:10 ERROR : Google drive root 'MCBackup/FluffCraft': not deleting files as there were IO errors
2023/11/01 18:18:10 ERROR : Google drive root 'MCBackup/FluffCraft': not deleting directories as there were IO errors
2023/11/01 18:18:10 ERROR : Attempt 2/3 failed with 1 errors and: directory not found
2023/11/01 18:18:10 ERROR : Local file system at /home/disruption/FluffCraft/backup: error reading source root directory: directory not found
2023/11/01 18:18:10 DEBUG : Google drive root 'MCBackup/FluffCraft': Waiting for checks to finish
2023/11/01 18:18:10 DEBUG : Google drive root 'MCBackup/FluffCraft': Waiting for transfers to finish
2023/11/01 18:18:10 ERROR : Google drive root 'MCBackup/FluffCraft': not deleting files as there were IO errors
2023/11/01 18:18:10 ERROR : Google drive root 'MCBackup/FluffCraft': not deleting directories as there were IO errors
2023/11/01 18:18:10 ERROR : Attempt 3/3 failed with 1 errors and: directory not found
Transferred:              0 B / 0 B, -, 0 B/s, ETA -
Errors:                 1 (retrying may help)
Elapsed time:         1.5s
2023/11/01 18:18:10 INFO  : 
Transferred:              0 B / 0 B, -, 0 B/s, ETA -
Errors:                 1 (retrying may help)
Elapsed time:         1.5s

2023/11/01 18:18:10 DEBUG : 6 go routines active
2023/11/01 18:18:10 Failed to sync: directory not found```

forget about rclone, make sure you can access the source dir using ls
once that is done, then try rclone

add -vv to the command, post the full output, not just snippets.

disruption@node01:~$ ./Backups.sh 
2023/11/01 18:40:59 DEBUG : rclone: Version "v1.64.2" starting with parameters ["rclone" "sync" "-P" "/home/disruption/FluffCraft/backup" "s:MCBackup/FluffCraft" "-vv"]
2023/11/01 18:40:59 DEBUG : Creating backend with remote "/home/disruption/FluffCraft/backup"
2023/11/01 18:40:59 DEBUG : Using config file from "/home/disruption/.config/rclone/rclone.conf"
2023/11/01 18:40:59 DEBUG : Creating backend with remote "s:MCBackup/FluffCraft"
2023/11/01 18:40:59 DEBUG : Google drive root 'MCBackup/FluffCraft': 'root_folder_id = 0AN-c_EFFdKKJUk9PVA' - save this in the config to speed up startup
2023/11/01 18:41:00 ERROR : Local file system at /home/disruption/FluffCraft/backup: error reading source root directory: directory not found
2023/11/01 18:41:00 DEBUG : Google drive root 'MCBackup/FluffCraft': Waiting for checks to finish
2023/11/01 18:41:00 DEBUG : Google drive root 'MCBackup/FluffCraft': Waiting for transfers to finish
2023/11/01 18:41:00 ERROR : Google drive root 'MCBackup/FluffCraft': not deleting files as there were IO errors
2023/11/01 18:41:00 ERROR : Google drive root 'MCBackup/FluffCraft': not deleting directories as there were IO errors
2023/11/01 18:41:00 ERROR : Attempt 1/3 failed with 1 errors and: directory not found
2023/11/01 18:41:00 ERROR : Local file system at /home/disruption/FluffCraft/backup: error reading source root directory: directory not found
2023/11/01 18:41:00 DEBUG : Google drive root 'MCBackup/FluffCraft': Waiting for checks to finish
2023/11/01 18:41:00 DEBUG : Google drive root 'MCBackup/FluffCraft': Waiting for transfers to finish
2023/11/01 18:41:00 ERROR : Google drive root 'MCBackup/FluffCraft': not deleting files as there were IO errors
2023/11/01 18:41:00 ERROR : Google drive root 'MCBackup/FluffCraft': not deleting directories as there were IO errors
2023/11/01 18:41:00 ERROR : Attempt 2/3 failed with 1 errors and: directory not found
2023/11/01 18:41:00 ERROR : Local file system at /home/disruption/FluffCraft/backup: error reading source root directory: directory not found
2023/11/01 18:41:00 DEBUG : Google drive root 'MCBackup/FluffCraft': Waiting for checks to finish
2023/11/01 18:41:00 DEBUG : Google drive root 'MCBackup/FluffCraft': Waiting for transfers to finish
2023/11/01 18:41:00 ERROR : Google drive root 'MCBackup/FluffCraft': not deleting files as there were IO errors
2023/11/01 18:41:00 ERROR : Google drive root 'MCBackup/FluffCraft': not deleting directories as there were IO errors
2023/11/01 18:41:00 ERROR : Attempt 3/3 failed with 1 errors and: directory not found
Transferred:              0 B / 0 B, -, 0 B/s, ETA -
Errors:                 1 (retrying may help)
Elapsed time:         1.9s
2023/11/01 18:41:00 INFO  : 
Transferred:              0 B / 0 B, -, 0 B/s, ETA -
Errors:                 1 (retrying may help)
Elapsed time:         1.9s

2023/11/01 18:41:00 DEBUG : 7 go routines active
2023/11/01 18:41:00 Failed to sync: directory not found
disruption@node01:~$ 

This is the full output and yes, i can access the directory

This issue only happens when launched from a bash script, not when launched from the shell direclty

which is correct?
isruption
or
disruption

forget about rclone, make sure ls and cp works from the script.
post the full output.

disruption is correct, the thing above was a copying error.
cp and ls work just fine from the script

we are just volunteers trying to help you and cannot see into your machine.
so please, post the full output of each command, each output, each time.

Output of cp -vv:
'rclone.deb' -> 'rclone.deb.bak'

Output of ls /home/disruption/FluffCraft:
backups baubles defaultconfigs libraries minecraftinstance.json ops.json patchouli_data.json schematics servers.dat whitelist.json
banned-ips.json config eula.txt local minecraft_server.1.16.5.jar options.txt resourcepacks server.jar usercache.json world
banned-players.json crash-reports journeymap logs mods patchouli_books saves server.properties usernamecache.json

rclone is correct, the source dir does not exist.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.