ltfs_ordered_copy
The ltfs_ordered_copy command copies files from the source to the destination with LTFS order optimization.
Note: The ltfs_ordered_copy command is not supported on Windows systems.
The command attempts to acquire a file list to copy to DESTINATION when no SOURCE is specified.
Command syntax
ltfs_ordered_copy [-p] [-r] [-t TARGET_DIRECTORY] [--keep-tree CUTOFF_PREFIX] [-a] [-v] [--verbose LOG_LEVEL] [-q] [-h] [SOURCE ...] [DESTINATION]
- Command options
-
- -a, --all
- Achieve the files recursively and preserve the attributes.
- --keep_tree=CUTOFF_PREFIX
- The
CUTOFF_PREFIX
is effective only when the file list is provided from stdin and the keep-tree option is enabled. TheCUTOFF_PREFIX
is removed from the file paths copied to the destination. - -p
- Preserve the attributes with shutil.copy2() in Python interpreter.
- -q, --quiet
- No message output.
- -r, --recursive
- Copy the directories recursively.
- -t, --target-directory=TARGET_DIRECTORY
- Copy all SOURCE arguments into the TARGET_DIRECTORY.
- -v
- Verbose output. Set VERBOSE level 5.
- --verbose=LOG_LEVEL
- Configure the verbosity of the logger. VERBOSE can be set to 0-6. (Default: 4)
Command examples
Simple
usage.
Copy file /foo/aaa to file /foo/bbb
$ ltfs_ordered_copy /foo/aaa /foo/bbb
Copy file /foo/aaa and /foo/bbb to directory /bar/
$ ltfs_ordered_copy /foo/aaa /foo/bbb /bar
Copy directory /foo/ddd and /foo/DDD to directory /bar/
$ ltfs_ordered_copy /foo/ddd /foo/DDD /bar
How to use with the find
command.
Copy all files under /foo/ddd to directory /bar
$ find /foo/ddd -type f | ltfs_ordered_copy -t /bar
Copy all directories just under /foo/ddd to directory /bar
$ find /foo/ddd -type d -maxdepth 1 | ltfs_ordered_copy -t /bar
Copy all files just under /foo/ddd to directory /bar with keeping tree (Chop /foo/ddd from source list)
$ find /foo/ddd -type f | ltfs_ordered_copy -t /bar --keep-tree=/foo/ddd