I have a webdav server containing thousands of files:
└── Sync
├── 20180719_120823.jpg
├── 20180719_120933.jpg
├── 20190719_120955.jpg
├── 20190719_121023.jpg
├── 20190719_121032.jpg
├── 20190720_121037.jpg
├── 20190721_120823.mp4
├── 20190822_220013.jpg
└── 20190822_230155.mp4
"
"
The first part of file name is YYYYMMDD. I want to use this to copy files to another drive using below structure. Bonus if MM is translated to name of month...:
├── 2018
│ └── Jul
│ ├── 20180719_120823.jpg
│ └── 20180719_120933.jpg
└── 2019
├── Jul
│ ├── 20190719_120955.jpg
│ ├── 20190719_121023.jpg
│ ├── 20190719_121032.jpg
│ ├── 20190720_121037.jpg
│ └── 20190721_120823.mp4
└── Aug
├── 20190822_220013.jpg
└── 20190822_230155.mp4
I can manually create the year/month structure. But it would be nice if the directories are created if it doesn't exist. The script will run once/day and if file already exist, we skip it.
2019/Aug/
structure, but2019/08/
(or maybe2019-08/
). That's likely much easier to work with in a variety of situations. It sorts well lexicographically, it's not case sensitive, it's not as much affected by localization. I understand if it's an existing structure you can't change; I figured I'd better share the advice anyway. – marcelm Oct 06 '23 at 20:422019/08-Aug/
Then it will be sorted in correct order... – carnock Oct 07 '23 at 10:08