Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/corion/app-moveyear
Move files to directories according to a date in their filename
https://github.com/corion/app-moveyear
Last synced: 7 days ago
JSON representation
Move files to directories according to a date in their filename
- Host: GitHub
- URL: https://github.com/corion/app-moveyear
- Owner: Corion
- Created: 2022-10-23T08:27:20.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-10-28T09:05:46.000Z (about 1 year ago)
- Last Synced: 2024-10-11T21:18:29.826Z (about 1 month ago)
- Language: Perl
- Size: 12.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
A minute tool to move files into a directory hierarchy using the date/time
in the filenames.# Usage
move-year --create -ymd -i ~/Downloads/bank-statement-2022-01-01.pdf ~/Documents/finance/my-bank/
move-year --create -dmy -i ~/Downloads/tax-report-31112021.pdf ~/Documents/finance/taxes/The files will be moved to the directories `~/Documents/finance/my-bank/2022`
and `~/Documents/finance/taxes/2021` respectively. Directories will be created.Move files into subdirectories according to year/month
move-year --create -s ym --part-separator "/" -ym -i foo-2022-03.pdf ~/Documents/foo
# Moves the file into ~/Documents/foo/2022/03# Options
* dry-run|n - only print, don't change anything
* verbose - output verbose messages
* date-regex|d - (Perl) regular expression to recognize the date parts
* date-regex-order|o - order of the components if you don't use named captures
* date-type - the date type to look for (dmy, ymd, ym, my, y)
* ymd - shorthand for --date-type=ymd
* dmy - shorthand for --date-type=dmy
* ym - shorthand for --date-type=ym
* my - shorthand for --date-type=my
* y - shorthand for --date-type=y
* force|f - overwrite files if they exist
* create - create intermediate directories
* directory-style|s - style of the directory (default: y)
* part-separator - separator of the directory parts, use "/" for subdirectories
* i - don't overwrite (the default)
* strict - stop if a file does not have a timestamp in its name