Upload text file with copy?


#1

Hi

I am trying to upload a b2zip file containing a bunch of paths using rclone:

rclone copy /tmp/somefile.bz2 remote:/this/path/where/fileshouldgo

But instead of copying the file to the remote, rclone tries to read the file and upload the paths (Most of which are gibberish as the file is b2zipped)

How can tell rclone to upload the file and not the content of the file?


#2

how if you use the end slash of destination?

rclone copy /tmp/somefile.bz2 remote:/this/path/where/fileshouldgo/


#3

What you’ve written should just upload the file as you expect.

So I suspect something else is going on… Can you post the actual command you run and its output?


#4

Here is the output from running it yesterday, I’m not sure that I can recreate the exact conditions again. So i probably can’t run it with debugging enabled.

2018/03/08 04:08:03 NOTICE: sh-np.m5JCPz: Can't transfer non file/directory
2018/03/08 04:08:03 NOTICE: sh-np.DlppVb: Can't transfer non file/directory
2018/03/08 04:08:03 ERROR : filelist.bz2: Failed to copy: mkdir /mnt/rclone/:Rai
dZero: read-only file system
2018/03/08 04:08:03 ERROR : Attempt 1/3 failed with 1 errors and: mkdir /mnt/rcl
one/:RaidZero: read-only file system
2018/03/08 04:08:03 NOTICE: sh-np.m5JCPz: Can't transfer non file/directory
2018/03/08 04:08:03 NOTICE: sh-np.DlppVb: Can't transfer non file/directory
2018/03/08 04:08:03 ERROR : filelist.bz2: Failed to copy: mkdir /mnt/rclone/:Rai
dZero: read-only file system
2018/03/08 04:08:03 ERROR : Attempt 2/3 failed with 1 errors and: mkdir /mnt/rcl
one/:RaidZero: read-only file system
2018/03/08 04:08:03 NOTICE: sh-np.m5JCPz: Can't transfer non file/directory
2018/03/08 04:08:03 NOTICE: sh-np.DlppVb: Can't transfer non file/directory     2018/03/08 04:08:03 ERROR : filelist.bz2: Failed to copy: mkdir /mnt/rclone/:Rai
dZero: read-only file system
2018/03/08 04:08:03 ERROR : Attempt 3/3 failed with 1 errors and: mkdir /mnt/rcl
one/:RaidZero: read-only file system
2018/03/08 04:08:03 Failed to copy: mkdir /mnt/rclone/:RaidZero: read-only file
system

Here is the same command that I ran just now.

root@freenas:~ # rclone --config /root/rclone.conf copy /tmp/filelist.bz2 gSuiteCrypted:test -vvv
2018/03/08 12:53:30 DEBUG : Using config file from "/root/rclone.conf"
2018/03/08 12:53:30 DEBUG : rclone: Version "v1.39" starting with parameters ["rclone" "--config" "/root/rclone.conf" "copy" "/tmp/filelist.bz2" "gSuiteCrypted:test" "-vvv"]
2018/03/08 12:53:32 INFO  : Encrypted drive 'gSuiteCrypted:test': Modify window is 1ms
2018/03/08 12:53:32 NOTICE: sh-np.m5JCPz: Can't transfer non file/directory
2018/03/08 12:53:32 NOTICE: sh-np.DlppVb: Can't transfer non file/directory
2018/03/08 12:53:32 DEBUG : .rnd: Excluded from sync (and deletion)
2018/03/08 12:53:32 DEBUG : nomad: Excluded from sync (and deletion)
2018/03/08 12:53:32 DEBUG : vi.recover: Excluded from sync (and deletion)
2018/03/08 12:53:32 DEBUG : sessionid0caf80xd3qg91zco0653aog1jyqseran: Excluded from sync (and deletion)
2018/03/08 12:53:32 DEBUG : alert: Excluded from sync (and deletion)
2018/03/08 12:53:32 DEBUG : nginx: Excluded from sync (and deletion)
2018/03/08 12:53:32 DEBUG : tmux-0: Excluded from sync (and deletion)
2018/03/08 12:53:32 DEBUG : .sync_disk_done: Excluded from sync (and deletion)
2018/03/08 12:53:32 DEBUG : firmware: Excluded from sync (and deletion)
2018/03/08 12:53:32 DEBUG : minio: Excluded from sync (and deletion)
2018/03/08 12:53:32 DEBUG : filelist: Excluded from sync (and deletion)
2018/03/08 12:53:32 DEBUG : sessionid3zv7372y1qu89hk7gczrqq8zsbyeg15t: Excluded from sync (and deletion)
2018/03/08 12:53:32 DEBUG : mail.queue: Excluded from sync (and deletion)
2018/03/08 12:53:32 DEBUG : rc.conf.freenas: Excluded from sync (and deletion)
2018/03/08 12:53:32 DEBUG : consul-notifications.log: Excluded from sync (and deletion)
2018/03/08 12:53:32 DEBUG : .smartalert: Excluded from sync (and deletion)
2018/03/08 12:53:32 DEBUG : .bootready: Excluded from sync (and deletion)
2018/03/08 12:53:32 DEBUG : consul: Excluded from sync (and deletion)
2018/03/08 12:53:32 DEBUG : freenas_config.md5: Excluded from sync (and deletion)
2018/03/08 12:53:32 DEBUG : ixdiagnose_boot.log: Excluded from sync (and deletion)
2018/03/08 12:53:33 DEBUG : test: Excluded from sync (and deletion)
2018/03/08 12:53:33 DEBUG : filelist.bz2: Size and modification time the same (differ by -917.308µs, within tolerance 1ms)
2018/03/08 12:53:33 DEBUG : filelist.bz2: Unchanged skipping
2018/03/08 12:53:33 INFO  : Encrypted drive 'gSuiteCrypted:test': Waiting for checks to finish
2018/03/08 12:53:33 INFO  : Encrypted drive 'gSuiteCrypted:test': Waiting for transfers to finish
2018/03/08 12:53:33 INFO  : 
Transferred:      0 Bytes (0 Bytes/s)
Errors:                 0
Checks:                 1
Transferred:            0
Elapsed time:        2.2s

2018/03/08 12:53:33 DEBUG : Go routines at exit 4
2018/03/08 12:53:33 DEBUG : rclone: Version "v1.39" finishing with parameters ["rclone" "--config" "/root/rclone.conf" "copy" "/tmp/filelist.bz2" "gSuiteCrypted:test" "-vvv"]

It looks like it tries to read all files even with copy and as the tmp dir includes pipes, it tries to read the output of those as input. I saw something much worse yesterday where it had all kinds of weird paths in the output as errors.


#5

I don’t think I can explain that without seeing the command line you ran :frowning:

Those logs look as expected. rclone copy copies one directory to another. When you give it a file it basically is a shortcut for running rclone copy --include file.ext src dst:

Those files aren’t read but they are listed in the directory and hence the really annoying error messages! I’d like to sort them out but I haven’t figured out how yet as the listing routines are at a much lower level than the routine doing the filtering.

You can use rclone copyto /tmp/somefile.bz2 remote:/this/path/where/fileshouldgo/somefile.bz2 if you want which won’t do the scanning of /tmp.


#6

It was the same command as in the second run, but that first one just looks all kinds of wrong.

I will try with copyto instead, thanks :slight_smile: