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.