Hi,
I have been trying for hours. I read multiple entries on different forums about this. And I still cannot achieve the correct filtering. Particularly Virtualbox VMs, I gave up and tried different versions of trying to exclude this damn folder.
The idea is to backup the home folder to Google Drive, excluding the folders that are either to big or not important to backup.
I tried the general syntax: -v --exclude "/.folder/**" for hidden folders -v --exclude "folder/**" for non hidden folders
I know I can shorten everything, I tried, it wasn't working so I went back to the basic switches to debug it.
I've been messing around more in this long command but here is the filter file that did not really work as well: https://pastebin.com/GTYqbPBY
With this command (2): sudo rclone sync -v -P --filter-from ~/Documents/scripts/filter.txt --dump filters /home/user google:/xps-backup/00/home/
I tried both options multiple times, if anyone have any ideas what to change or tell me what I am doing wrong. Is it because I am using /home/user/ instead of /home/user as a source?
Your filter file look pretty good I would stick to using a filter-from file.
I think you want a + * at the bottom of the filer file just to be explicit about what happens to all the other files that didn't match anything so far.
Note that you don't want escaping in the filter from file.
- /Virtualbox VMs/**
Note that if you don't use a leading / rclone will exclude any directory called Pictures and its contents from anywhere in the file system hierarchy. That may be what you want I'm not sure.
- Pictures/**
Using rclone ls --filter-from file.txt /home/user/ is an easy way to test filters.
Ok so I clearly forgot to describe the problem I was to frustrated, my bad sorry.
The problem is that the filtering is not working, it is still uploading the map Virtualbox VMs amongst other files. I do not trust the filters I am using. So when I do rclone sync /home/user remote:/target/
And I want to filter out Pictures
I need to put - "Pictures/**"' - "/Pictures/**" wont work as far as I understand?
Note that you don't want escaping in the filter from file.
- /Virtualbox VMs/**
I put that folder in different ways in the filter file and it was still uploading as I was looking at the verbose output and progress. Amongst other things are still ending up on the remote.
Using `rclone ls --filter-from file.txt /home/user/` is an easy way to test filters.
This looks like a better way indeed, thank you
Further, on this topic, imagine I get all the filters working like I want and there is still old files in the remote. Where do I put --delete-excluded ?
The first one (no /) will filter out `/home/user/Pictures` , `/home/user/subdir/Pictures` and `/home/user/sub/subdir/Pictures`
whereas the second will only filter out `/home/user/Pictures`
Is that clearer?
Yes
You are writing it now without the quotation marks, this is not necessary in the filter file?
I'd probably focus on the filter from which is the second one. It doesn't look like you have anything to back up included in the filter list.
Haha I guess you are right, I ended up with a really cumbersome looking bash script, that was before I found that you can make a filter file. And after I stopped trusting the filter file.
I think you want a + * at the bottom of the filer file just to be explicit about what happens to all the other files that didn't match anything so far.
Wait what, does that + * do at the bottom?
Sorry it was a crazy busy day yesterday between figuring out rclone I am going over this again today with more sleep and less coffee.
So I used rclone ls --filter-from on the filter file and it spit out everything it would exclude, looked good, I found Virtualbox VMs in there. So I started the sync and it completely ignored the filter for Virtualbox VMs, what am I doing wrong?
Ok turns out you need to put - /'VirtualBox VMs'/** in the filter file and not -/VirtualBox VMs/**
It wont work otherwise same with the folder " 'Calibre Library' " for example
I did rclone ls src --filter-from filter/file/location.txt | grep VMs
With this in the filter file /'VirtualBox VMs'/** and the output was this: https://pastebin.com/u9Eee8wm
VirtualBox VMs was showing up, great!
So I went ahead with the sync, and the huge folder still ended up in the remote location.
Ubuntu 18 5.0.0-27-generic #28~18.04.1-Ubuntu SMP Thu Aug 22 03:00:32 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
I did the rclone ls --filter-from file.txt /home/user/ etc command and it was not showing up when the folder was written without the quotes.
When I changed it to /'VirtualBox VMs'/** It showed up in the output so yeah I went ahead and ran the sync command.
I caved sir, I just added all the virtualbox file types to the file type exclusion list as you can see. And that also worked. Still do not understand what I am doing wrong though.
Do you think it has something to do with the shell I am using? zsh?