mk-conn / structured-file-copy
一个用于从源文件夹复制文件到目标文件夹结构的轻量级命令行工具
0.0.4
2020-06-08 21:53 UTC
Requires
- php: >=7.3
- symfony/console: 5.1.0
- symfony/filesystem: 5.1.0
- symfony/finder: 5.1.0
- symfony/mime: 5.1.0
This package is auto-updated.
Last update: 2024-09-23 19:16:41 UTC
README
一个用于从源文件夹复制文件到目标文件夹结构的轻量级命令行工具
为什么选择PHP而不是直接使用给定的命令行Linux/Unix工具呢?
- 嗯...我喜欢这样:
structure-copy copy:struct --file-type=image --sort=date:year --sort=date:month
而不是find -type | xargs... err what?.. err.. 下一个Unix工具用于管道和过滤文件或类型是什么...? *叹气* 让我们看看Stack Overflow 😊
- 我主要用它来复制相机/手机中的照片和视频到本地库中,该库按年月排序。
如何使用
安装
composer global require "mk-conn/structured-file-copy"
或安装到您选择的自定义位置
git clone https://github.com/mk-conn/structured-file-copy.git
用法
Composer已添加到全局路径?太好了!只需运行
structure-copy copy:struct --target=/target/folder [--file-type=<file-type1,n>] [--source=/source/path] [--file-ext=<ext1,n>] [--sort=date:year] [--sort=date:month]
没有?
~/.composer/vendor/bin/structure-copy copy:struct --target=/target/folder [--file-type=<file-type1,n>] [--source=/source/path] [--file-ext=<ext1,n>] [--sort=date:year] [--sort=date:month]
获取帮助
$ structure-copy copy:struct --help
Description:
Copies files from a source folder to a target folder but in a sctructured way if you want.
Usage:
copy:struct [options]
Options:
--source[=SOURCE] The from folder (if not set, files are taken from the folder where the command is running)
--target=TARGET Where to put the files
--sort[=SORT] Sort in folders by (date:day,date:month,date:year,alpha:name) (multiple values allowed)
--name-letters[=NAME-LETTERS] By how many (first) letters should the name sorted
--exclude-ext[=EXCLUDE-EXT] Exclude files with extensions (multiple values allowed)
--file-type[=FILE-TYPE] Move only a file type [image, video, office, text, richtext, pdf] (multiple values allowed)
--file-ext[=FILE-EXT] Move only files with a specific extension (multiple values allowed)
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
待定
- 添加干燥运行
- 如果不需要,则在结束时省略日志
- 按日期:日排序到文件夹
- 按用户定义的前导字母数量按文件名排序到文件夹
- 编写测试