Toasty27/codecraft-init-script — comment on commit 3899adb474a7139142cdd9f720d618c71f079453
File:  line 0
By Toasty27:

There is a potential problem with this script due to it's use of time and dates. There is the potential that the directories could be mis-named if the backup function is called immediately prior to midnight (say, 11:59:59 or something). In that event, the current code would generate a folder titled 00:0X (where X = some integer) under the folder with the date of the previous day.

To fix this, a check needs to be made after the creation of the child directory to verify that the current date matches that of the label given to the parent directory. In the event that it doesn't match, the child directory needs to be moved to a folder who's label is the current date (as given by `date "+%Y.%m.%d"` ).

This needs to be done to prevent a folder from being made that has a label suggesting it's older than another folder in the same directory when it is, in fact, about 24 hours older.