wolfv6/rclone_jobber

Doesn't work with folders/files with spaces

turkeyphant opened this issue · 9 comments

No matter whether you pass double quoted or single quoted paths to rclone_jobber, you get an error of the following type:

Command lsf needs 1 arguments maximum: you provided 2 non flag arguments: ["'/mnt/user/Google" "Drive/'"]
ERROR: backup_Google aborted because source is empty.

The "aborted because source is empty." message comes from rclone_jobber.sh line 83:

# if source is empty
if ! test "$(rclone lsf --max-depth 1 $source)"; then  # rclone lsf requires rclone 1.40 or later
    print_message "ERROR" "aborted because source is empty."
    exit 1
fi

Are you passing in source equal to "'/mnt/user/Google" "Drive/'"?

No. "/mnt/user/Google Drive"

Please read reclone_jobber_tutorial section "If source or dest paths contain a space".

Please read reclone_jobber_tutorial section "If source or dest paths contain a space".

I had tried that also. Still get an error:

On Linux: source="'/mnt/user/Google Drive/'"

ERROR: backup_Google aborted because source is empty.
'/mnt/user/Google [error opening dir]
Drive/' [error opening dir]```

I will look at this over the weekend.

Fixed in rclone_jobber.sh v1.5.5

Changed line 83 to:
if ! test "rclone lsf --max-depth 1 $source"; then # rclone lsf requires rclone 1.40 or later

Partially works:

job file:

#!/usr/bin/env sh

################################### license ##################################
# job_backup_to_remote.sh calls rclone_jobber to perform a backup to remote.
# Written in 2018 by Wolfram Volpi, contact at https://github.com/wolfv6/rclone_jobber/issues.
# To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide.
# This software is distributed without any warranty.
# You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see http://creativecommons.org/publicdomain/zero/1.0/.
# rclone_jobber is not affiliated with rclone.
##############################################################################

#substitute $rclone_jobber and ${remote} with paths on your system
rclone_jobber="/mnt/user/test/rclone_jobber" #path to rclone_jobber directory

source="'/mnt/user/testing space/'"
dest="'remote:testing space'"
move_old_files_to="dated_directory"
options="-v -P --filter-from=$rclone_jobber/examples/filter_rules"
monitoring_URL=""

$rclone_jobber/rclone_jobber.sh "$source" "$dest" "$move_old_files_to" "$options" "$(basename $0)" "$monitoring_URL"

#display test directories (display for tutorial only, don't do this in production)
tree -a $source
rclone ls $dest

output:

# ./spacetest.sh
Back up in progress 2020-05-18_16:57:55 spacetest.sh
rclone sync '/mnt/user/testing space/' 'remote:testing space'/last_snapshot --backup-dir='remote:testing space'/archive/2020/2020-05-18_16:57:55 --log-file=/mnt/user/test/rclone_jobber/rclone_jobber.log -v -P --filter-from=/mnt/user/test/rclone_jobber/examples/filter_rules
Transferred:      104.931k / 104.931 kBytes, 100%, 8.354 kBytes/s, ETA 0s
Transferred:            6 / 6, 100%
Elapsed time:        12.5s
2020-05-18_16:58:14 completed spacetest.sh
'/mnt/user/testing [error opening dir]
space/' [error opening dir]

0 directories, 0 files
Usage:
  rclone ls remote:path [flags]

Flags:
  -h, --help   help for ls

Use "rclone [command] --help" for more information about a command.
Use "rclone help flags" for to see the global flags.
Use "rclone help backends" for a list of supported services.
Command ls needs 1 arguments maximum: you provided 2 non flag arguments: ["'remote:testing" "space'"]

Is the error coming from the last two lines of the job file?

#display test directories (display for tutorial only, don't do this in production)
tree -a $source
rclone ls $dest

Is the error coming from the last two lines of the job file?

#display test directories (display for tutorial only, don't do this in production)
tree -a $source
rclone ls $dest

Correct. Now those are the only two commands failing:

test tree


'/mnt/user/testing [error opening dir]
space/' [error opening dir]

0 directories, 0 files


test ls


Usage:
  rclone ls remote:path [flags]

Flags:
  -h, --help   help for ls

Use "rclone [command] --help" for more information about a command.
Use "rclone help flags" for to see the global flags.
Use "rclone help backends" for a list of supported services.
Command ls needs 1 arguments maximum: you provided 2 non flag arguments: ["'remotet:testing" "space'"]