Batch link files without modifying original files.
Project description
batchlink
Batch link files without modifying original files.
Why
To solve the problem - Is there a way to rename files from a torrent and still be able to seed? If you are serving BT files on a media server like Jellyfin, you may want this.
Features
- A CLI to easily batch link, rename, copy files.
- An extensible library.
Examples
Create example files:
mkdir -p a b && touch a/0.log a/1.log a/1.txt a/2.txt
Create hard links in b/
pointing to all files in a/
with original file names:
[!NOTE] It's recommended to add option
--dry-run
to see what will happen at first.
$ batchlink -S a -d b '*' '{path}'
Create hard link b/0.log to a/0.log
Create hard link b/1.log to a/1.log
Create hard link b/1.txt to a/1.txt
Create hard link b/2.txt to a/2.txt
Only create links for log files:
$ batchlink -S a -d b '*.log' '{path}'
Create hard link b/0.log to a/0.log
Create hard link b/1.log to a/1.log
And rename to one-based numbering file names:
$ batchlink -S a -d b '*.log' '{num}.log'
Create hard link b/1.log to a/0.log
Create hard link b/2.log to a/1.log
Format replacement values:
$ batchlink -S a -d b '*.log' '{num:02}.log'
Create hard link b/01.log to a/0.log
Create hard link b/02.log to a/1.log
Absolute symbolic link, relative symbolic link, rename, copy:
batchlink -s -S a -d b '*.log' '{num:02}.log'
batchlink -sR -S a -d b '*.log' '{num:02}.log'
batchlink -r -S a -d b '*.log' '{num:02}.log'
batchlink -c -S a -d b '*.log' '{num:02}.log'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
batchlink-1.0.0.tar.gz
(7.4 kB
view hashes)
Built Distribution
Close
Hashes for batchlink-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b67ae0ed90cee5d139d94ba54c499592cc1e8576e6af8133419b36a75480b774 |
|
MD5 | 10dbe1bd1c428aa838fbefa4c7ba7a01 |
|
BLAKE2b-256 | 5bb2efd10591f36ca58fa6aa71e83608f8b9bbbbd1b6c65a54652bed427a4f27 |