--exclude-from seems not to work

I am testing Rclone --exclude-form. I have a simlple directory

H:\programs\Test_Rclone with one file in it test.iso

When I run rclone with -exclude *.iso, the file does not get copied to Onedrive

When I run Rclone with --exclude-from exclude-file.txt with a single record *.iso, the iso file is copied to the cloud.

i’ve read everything I can find and am pulling my hair out! can someone please correct my error?

1st Time through, test.iso file ignored
command line = & D:\Rclone\rclone.exe “sync” “H:\programs\Test_Rclone” “OneDrive:Test_rclone” ‘–size-only’ ‘-vv’ “–exclude” ‘*.iso’ ‘–log-file’ ‘C:\Users\lordn\Downloads\test.log’

2018/12/06 16:30:06 DEBUG : rclone: Version “v1.45” starting with parameters [“D:\Rclone\rclone.exe” “sync” “H:\programs\Test_Rclone” “OneDrive:Test_rclone” “–size-only” “-vv” “–exclude” “*.iso” “–log-file” “C:\Users\lordn\Downloads\test.log”]
2018/12/06 16:30:06 DEBUG : Using config file from “C:\Users\lordn\.rclone.conf”
2018/12/06 16:30:06 DEBUG : One drive root ‘Test_rclone’: Token expired but no uploads in progress - doing nothing
2018/12/06 16:30:09 DEBUG : Keeping previous permissions for config file: -rw-rw-rw-
2018/12/06 16:30:09 DEBUG : OneDrive: Saved new token in config file
2018/12/06 16:30:12 DEBUG : test.iso: Excluded
2018/12/06 16:30:12 INFO : One drive root ‘Test_rclone’: Waiting for checks to finish
2018/12/06 16:30:12 INFO : One drive root ‘Test_rclone’: Waiting for transfers to finish
2018/12/06 16:30:12 INFO : Waiting for deletions to finish
2018/12/06 16:30:12 INFO :
Transferred: 0 / 0 Bytes, -, 0 Bytes/s, ETA -
Errors: 0
Checks: 0 / 0, -
Transferred: 0 / 0, -
Elapsed time: 5.8s

2nd time through
Command line = & D:\Rclone\rclone.exe “sync” “H:\programs\Test_Rclone” “OneDrive:Test_rclone” ‘–size-only’ ‘-vv’ “–exclude-from” ‘C:\Users\lordn\Downloads\exclude-file.txt’ ‘–log-file’ ‘C:\Users\lordn\Downloads\test.log’
C:\Users\lordn\Downloads\exclude-file.txt = *.iso

2018/12/06 16:30:12 DEBUG : 5 go routines active
2018/12/06 16:30:12 DEBUG : rclone: Version “v1.45” finishing with parameters [“D:\Rclone\rclone.exe” “sync” “H:\programs\Test_Rclone” “OneDrive:Test_rclone” “–size-only” “-vv” “–exclude” “*.iso” “–log-file” “C:\Users\lordn\Downloads\test.log”]
2018/12/06 16:30:12 DEBUG : rclone: Version “v1.45” starting with parameters [“D:\Rclone\rclone.exe” “sync” “H:\programs\Test_Rclone” “OneDrive:Test_rclone” “–size-only” “-vv” “–exclude-from” “C:\Users\lordn\Downloads\exclude-file.txt” “–log-file” “C:\Users\lordn\Downloads\test.log”]
2018/12/06 16:30:12 DEBUG : Using config file from “C:\Users\lordn\.rclone.conf”
2018/12/06 16:30:14 INFO : One drive root ‘Test_rclone’: Waiting for checks to finish
2018/12/06 16:30:14 INFO : One drive root ‘Test_rclone’: Waiting for transfers to finish
2018/12/06 16:30:16 DEBUG : test.iso: Starting multipart upload
2018/12/06 16:30:17 DEBUG : test.iso: Uploading segment 0/699004928 size 10485760
2018/12/06 16:30:37 DEBUG : test.iso: Uploading segment 10485760/699004928 size 10485760
2018/12/06 16:30:57 DEBUG : test.iso: Uploading segment 20971520/699004928 size 10485760
2018/12/06 16:31:14 INFO :
Transferred: 30M / 666.623 MBytes, 5%, 498.579 kBytes/s, ETA 21m47s
Errors: 0
Checks: 0 / 0, -
Transferred: 0 / 1, 0%
Elapsed time: 1m1.6s
Transferring:

  •                                  test.iso:  4% /666.623M, 531.032k/s, 20m27s
    

2018/12/06 16:31:16 DEBUG : test.iso: Uploading segment 31457280/699004928 size 10485760

Can you run add --dump filters to the command line and see what that says? It should look like this

--- start filters ---
--- File filter rules ---
- (^|/)[^/]*\.iso$
--- Directory filter rules ---
--- end filters ---

I wonder if rclone is getting confused by windows line endings or something like that.

Thank you @ncw indeed dump filters has shown that the windows file is corrupt…

PS D:\OneDrive\WindowsPowerShell> & D:\Rclone\rclone.exe “sync” “H:\programs\Test_Rclone” “OneDrive:Test_rclone” ‘–size-only’ ‘-vv’ “–exclude” ‘*.iso’ ‘–dump’ ‘filters’ ‘–log-file’ ‘C:\Users\lordn\Downloads\test.log’
— start filters —
— File filter rules —

  • (^|/)[^/]*.iso$
    — Directory filter rules —
    — end filters —

PS D:\OneDrive\WindowsPowerShell> $excludes = ‘*.iso’
$excludes | Out-File C:\Users\lordn\Downloads\exclude-file.txt
$excludes = ‘C:\Users\lordn\Downloads\exclude-file.txt’
& D:\Rclone\rclone.exe “sync” “H:\programs\Test_Rclone” “OneDrive:Test_rclone” ‘–size-only’ ‘-vv’ “–exclude-from” ‘C:\Users\lordn\Downloads\exclude-file.txt’ ‘–dump’ ‘filters’ ‘–log-file’ ‘C:\Users\lordn\Downloads\test.log’
— start filters —
— File filter rules —

  • (^|/)��[^/]* . i s o
    $
  • (^|/) $
    — Directory filter rules —
    — end filters —

$excludes = ‘*.iso’
$excludes | Out-File C:\Users\lordn\Downloads\exclude-file.txt -Encoding ascii

Adding -Encoding ascii

has fixed the problem

PS D:\OneDrive\WindowsPowerShell> & D:\Rclone\rclone.exe “sync” “H:\programs\Test_Rclone” “OneDrive:Test_rclone” ‘–size-only’ ‘-vv’ “–exclude-from” ‘C:\Users\lordn\Downloads\exclude-file.txt’ ‘–dump’ ‘filters’ ‘–log-file’ ‘C:\Users\lordn\Downloads\test.log’
— start filters —
— File filter rules —

  • (^|/)[^/]*.iso$
    — Directory filter rules —
    — end filters —

2018/12/06 21:46:53 DEBUG : rclone: Version “v1.45” starting with parameters [“D:\Rclone\rclone.exe” “sync” “H:\programs\Test_Rclone” “OneDrive:Test_rclone” “–size-only” “-vv” “–exclude-from” “C:\Users\lordn\Downloads\exclude-file.txt” “–dump” “filters” “–log-file” “C:\Users\lordn\Downloads\test.log”]
2018/12/06 21:46:53 DEBUG : Using config file from “C:\Users\lordn\.rclone.conf”
2018/12/06 21:46:54 DEBUG : test.iso: Excluded
2018/12/06 21:46:55 INFO : One drive root ‘Test_rclone’: Waiting for checks to finish
2018/12/06 21:46:55 INFO : One drive root ‘Test_rclone’: Waiting for transfers to finish
2018/12/06 21:46:55 INFO : Waiting for deletions to finish
2018/12/06 21:46:55 INFO :
Transferred: 0 / 0 Bytes, -, 0 Bytes/s, ETA -
Errors: 0
Checks: 0 / 0, -
Transferred: 0 / 0, -
Elapsed time: 1.5s

2018/12/06 21:46:55 DEBUG : 5 go routines active
2018/12/06 21:46:55 DEBUG : rclone: Version “v1.45” finishing with parameters [“D:\Rclone\rclone.exe” “sync” “H:\programs\Test_Rclone” “OneDrive:Test_rclone” “–size-only” “-vv” “–exclude-from” “C:\Users\lordn\Downloads\exclude-file.txt” “–dump” “filters” “–log-file” “C:\Users\lordn\Downloads\test.log”]

It looks like that text file is in UTF-16 format or something like that…

How did you make it BTW?

@ncw Standard powershell

$excludes = ‘*.iso’
$excludes | Out-File C:\Users\lordn\Downloads\exclude-file.txt -Encoding ascii

now writes it correctly.

1 Like