Comments (18)
OK, I see.
fpart exclusions, when used through fpsync, are relative to the src path (because fpsync changed its current working directory to the src dir), so you should use the following :
sudo "PATH=$PATH" /usr/local/bin/fpsync -n $_thread_count -v -o "-a --stats --numeric-ids" -O '-X ./cache'
pwd/src/
pwd/trg/
Remember you can build fpart with the --enable-debug option to get feedback about included/excluded files and directories.
from fpart.
Hi David,
Yes, it should be :
$ mkdir /tmp/{src,dst}
$ touch /tmp/src/{foo,bar,baz}
$ fpsync -o '-lptgoD -v --numeric-ids --exclude=bar' /tmp/src /tmp/dst
$ ls /tmp/dst
baz foo
from fpart.
Yeah, just tried that but it still syncs that folder. I think it is worth to mention that I'm trying to exclude a folder and not a file.
sudo "PATH=$PATH" /usr/local/bin/fpsync -o '-lptgoD -v --numeric-ids --exclude=cache' \
`pwd`/source/ `pwd`/destination/
It still copies over the cache folder which I'm trying to exclude.
from fpart.
Right, this is because fpsync calls fpart which, by default, generates a list of files to synchronize. Thus, excluding a directory at rsync level cannot work because it will always create a parent directory even if it is excluded :
$ mkdir /tmp/{src,dst}
$ mkdir /tmp/src/{foo,bar,baz}
$ touch /tmp/src/{foo,bar,baz}/file
$ fpsync -o '-lptgoD -v --numeric-ids --exclude=bar' /tmp/src /tmp/dst
$ ls /tmp/dst/bar
file
Here, rsync created the 'bar' directory because it was asked to synchronize bar/file.
You have to exclude the directory earlier by using fpart options :
$ fpsync -O '-x bar' /tmp/src /tmp/dst
$ ls /tmp/dst
baz foo
That way, bar/file will not appear at all in the (internal) file list to synchronize.
from fpart.
@martymac thanks for your assistance on this. Will it accept path in the -x
arg ? As it's now it's excluding everything from /tmp/src
with a name bar
e.g.
fpsync -O '-x /bar' /tmp/src /tmp/dst
Thanks !
from fpart.
This is the intended behaviour. Unfortunately, there is currently no way to exclude a specific path from fpart as -x only acts on file or directory names (not paths, but that could be an improvement).
Coming back to my first answer, rsync accepts relative paths in its --exclude option, so you may (this is to be tested) be able to exclude all files from that directory with something like : --exclude=bar/*
Note that fpart will crawl that directory and add its files to the produced partitions anyway.
Best regards,
Ganael.
from fpart.
Hello David,
I've implemented ability to specify paths with options '-y', '-Y', '-x' and '-X', that should solve your problem. An exclusion will be considered to be a path when it contains at leat a '/' character. You can mix file names and paths and inclusion/exclusion rules remain the same as before.
Hope this helps,
Best regards,
Ganael.
from fpart.
Hello Ganael,
Thanks for spending time on this ! Much appreciated.
All the best !
David
from fpart.
Hey @martymac
Downloaded and installed the v1.1.0
I just tried:
sudo "PATH=$PATH" /usr/local/bin/fpsync -n $_thread_count -v -o "-a --stats --numeric-ids" -O '-X /cache' /tmp/src/ /tmp/dest/
and nothing really changed. It's still copying over the entire cache folder.
Thanks !
from fpart.
Hi David,
The fix is not in 1.1.0, but in git only (master branch) ; it will be integrated in the next release. You can rebuild fpart from source to get it now if necessary.
Best regards,
Ganael.
from fpart.
I tried to use the master and compiled it but it still copies over the directory.
Used:
sudo "PATH=$PATH" /usr/local/bin/fpsync -n $_thread_count -v -o "-a --stats --numeric-ids" -O '-X /cache' /tmp/src/ /tmp/dest/
$ fpsync
fpsync v1.2.0 - Sync directories in parallel using fpart
Copyright (c) 2014-2019 Ganael LAPLANCHE <[email protected]>
from fpart.
Hi David,
Excluded path must patch the root path of the crawled filesystem. In your case, you should exclude the following path : '/tmp/src/cache'. Can you try that ?
from fpart.
Hey Ganael,
Nope, tried it and it still copies it over.
sudo "PATH=$PATH" /usr/local/bin/fpsync -n $_thread_count -v -o "-a --stats --numeric-ids" -O '-X '`pwd`'/src/cache' `pwd`/src/ `pwd`/trg/
from fpart.
Hi,
are you sure fpsync uses the latest version of fpart you compiled and not a previous version of the binary you installed before ?
from fpart.
Hey,
Yes, looks like it.
$ sudo /usr/local/bin/fpsync -v
fpsync v1.2.0 - Sync directories in parallel using fpart
Copyright (c) 2014-2019 Ganael LAPLANCHE <[email protected]>
WWW: http://contribs.martymac.org
Usage: /usr/local/bin/fpsync [OPTIONS...] src_dir/ dst_url/
Usage: /usr/local/bin/fpsync [-r jobname] [OPTIONS...]
from fpart.
Hello,
I mean, check that the fpsync script itself uses the latest version of fpart. That latest version should be in your $PATH; it is determined that way by the script :
FPART_BIN="$(which fpart)"
Best regards,
Ganael.
from fpart.
Yes it is.
fpart v1.2.0
Copyright (c) 2011-2019 Ganael LAPLANCHE <[email protected]>
WWW: http://contribs.martymac.org
Build options: debug=no, fts=system
from fpart.
Hey Ganael,
This did the trick:
'-X ./cache'
Thanks so much for your assistance !
from fpart.
Related Issues (20)
- Throttle fpsync transfer rate HOT 1
- Add multi-thread support while crawling the file system HOT 3
- Single files support HOT 5
- fpart: incomplete partitions on sshfs HOT 9
- Meaning of 0th partition file in different modes is confusing HOT 23
- Format change for '-S' output HOT 7
- sorting with mathematical function HOT 1
- Problem running fpsync with GNU parallel or in background from the shell, the process will go in STOP state HOT 11
- fpart/fsync is slowly when reading files names from S3 or similiar object file system HOT 1
- Status / percentage complete / progress bar? HOT 1
- Sub-directories and files are not getting copied to the destination HOT 8
- fpsync status/progress reporting does not work correctly HOT 4
- fpsync does not provide a way to specify number of file parts HOT 4
- How to sync local directory to a remote directory by fpsync HOT 1
- fpsync: job control error running under cron HOT 3
- How to burn the partition content to DVD / Blu-ray? HOT 1
- How can I create partitions respecting the directory name in alphabatical order? HOT 1
- Incompatible option(s) detected within toolopts (option -o) HOT 1
- having issues with excluding directories or files, macOS HOT 8
- using sshpass does not seem to work with fpsync HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fpart.