Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work with folders/files with spaces #13

Open
turkeyphant opened this issue May 11, 2020 · 9 comments
Open

Doesn't work with folders/files with spaces #13

turkeyphant opened this issue May 11, 2020 · 9 comments

Comments

@turkeyphant
Copy link

turkeyphant commented May 11, 2020

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.
@wolfv6
Copy link
Owner

wolfv6 commented May 12, 2020

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/'"?

@turkeyphant
Copy link
Author

turkeyphant commented May 12, 2020

No. "/mnt/user/Google Drive"

@wolfv6
Copy link
Owner

wolfv6 commented May 12, 2020

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

@turkeyphant
Copy link
Author

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]```

@wolfv6
Copy link
Owner

wolfv6 commented May 14, 2020

I will look at this over the weekend.

wolfv6 added a commit that referenced this issue May 17, 2020
@wolfv6
Copy link
Owner

wolfv6 commented May 17, 2020

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

@wolfv6 wolfv6 closed this as completed May 17, 2020
@turkeyphant
Copy link
Author

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'"]

@wolfv6
Copy link
Owner

wolfv6 commented May 25, 2020

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

@wolfv6 wolfv6 reopened this May 25, 2020
@turkeyphant
Copy link
Author

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'"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants