NewDay.exe is a small program that can be run to create a new 0day directory. It can also make a Symlink for ioFTPD or a shortcut for Serv-U. Be aware that a shortcut/symlink can not be made if the new day dir is not there. It will look for an FTPServerTools.ini (in the same dir as the exe) with for example [Directories] AutoCreate=c:\FTP\0Day\%m%d|c:\FTP\Yesterday 0day|/0Day/%m%d|-1|-1 AutoCreate=c:\FTP\0Day\%m%d|c:\FTP\ToDay 0day|/0Day/%m%d|0|1 AutoCreate=c:\FTP\0Day\%m%d|c:\FTP\Tomorrow 0day|/0Day/%m%d|1|1 AutoCreate=c:\FTP\MP3\%m%d|c:\FTP\ToDay MP3|/MP3/%m%d|0|1 AutoCreate=c:\FTP\EBooks\%m%d|||1|0 AutoCreate=c:\FTP\MP3\%m%d|c:\FTP\YesterDay MP3|/MP3/%m%d|| ; This is needed for the creation of new directories every day, including their symlinks (ioFTPD) or shortcuts (Serv-U) ; The syntax of these lines is: ; AutoCreate=DatedDirPath|ShortCutPath|VirtualPath|DaysAhead|DaysBack ; DatedDirPath this is the actual new directory that is being created ; ShortcutPath this is the shortcut/symlink that is being created (Serv-U) or the directory that is being created to function as shortcut (ioFTPD) ; VirtualPath this is the comment for the chortcut (Serv-U) or the virtual path where the symlink points to (ioFTPD) ; DaysBegin this is the number of days that will be added to the current day where the dir creation range starts (default=0), ; this is the day that the symlink/shortcut points to. ; DaysEnd this is the number of days that will be added to the current day where the dir creation range stops (default=0). ; ; Some extra exaplanation for DaysBegin and DaysAhead: ; Assume the current date is Jan 19 and DaysBegin=-1 and DaysEnd=1 ; Then Jan 18 (=Jan 19+DaysBegin) is the first dir that will be created. ; Then Jan 19 will be created. ; Then Jan 20 (=Jan 19+DaysEnd) will be created. ; OldVFS will be performed on Jan 18 ; NewVFS will be performed on Jan 19 and Jan 20 ; the shortcut/symlink will be created on Jan 18 (since DaysBegin starts there). ; ; Leaving out any part of it will cause the line to be skipped, you can fill in a empty string tho. ; The DatedDirPath as well as the VirtualPath should use time cookies like the ones mentioned below ; %a Abbreviated weekday name ; %A Full weekday name ; %b Abbreviated month name ; %B Full month name ; %c Date and time representation appropriate for locale ; %d Day of month as decimal number (01 - 31) ; %H Hour in 24-hour format (00 - 23) ; %I Hour in 12-hour format (01 - 12) ; %j Day of year as decimal number (001 - 366) ; %m Month as decimal number (01 - 12) ; %M Minute as decimal number (00 - 59) ; %p Current locale’s A.M./P.M. indicator for 12-hour clock ; %S Second as decimal number (00 - 59) ; %U Week of year as decimal number, with Sunday as first day of week (01 - 53) ; %w Weekday as decimal number (0 - 6; Sunday is 0) ; %W Week of year as decimal number, with Monday as first day of week (01 - 53) ; %x Date representation for current locale ; %X Time representation for current locale ; %y Year without century, as decimal number (00 - 99) ; %Y Year with century, as decimal number ; %z, %Z Time-zone name or abbreviation; no characters if time zone is unknown ; %% Percent sign ; As in the printf function, the # flag may prefix any formatting code. In that case, the meaning of the format code is changed as follows. ; Format Code Meaning ; %#a, %#A, %#b, %#B, %#p, %#X, %#z, %#Z, %#% # flag is ignored. ; %#c Long date and time representation, appropriate for current locale. For example: Tuesday, March 14, 1995, 12:41:29. ; %#x Long date representation, appropriate to current locale. For example: Tuesday, March 14, 1995. ; %#d, %#H, %#I, %#j, %#m, %#M, %#S, %#U, %#w, %#W, %#y, %#Y Remove leading zeros (if any). y, %#Y Remove leading zeros (if any). [TimeSettings] Use=UTC ; Use UTC time or localtime, UTC time has no summer/winter time, Local has summer and winter time. ; UTC - The UTC time is taken from your computer to count with, UTC is roughly the same as GMT (except a few milliseconds) ; Local - The local time is taken from your computer to coutn with, this is the time on your clock. ; Option:UTC or Local ; Default:Local ; Used for:NewDay.exe HoursAhead=1 ; This number of hours gets added to the UTC or Local time to create directories that are ahead of the current time counting from the UTC or GMT time (Use= setting). ; Default:0 ; Used for:NewDay.exe [FTPServer] ;ServerType=ioFTPD ; Only use for ioFTPD ;ServerType=Serv-U 6.x ; For Serv-U 6.x [ioFTPD] NewVFS=!vfs:add 777 0:0 %[Dir] ; Default: no setting ; Used for: NewDay.exe ; command being performed on the newly created dirs, here %[Dir] is replace automatically with the complete path to the newly created dir OldVFS=!vfs:add 755 0:0 %[Dir] ; Default: no setting ; Used for: NewDay.exe ; command being performed on the older dirs (Today-DaysBack) so if its 31-jan it works on 30-jan, , here %[Dir] is replace automatically with the complete path to the old dir Version history: 1.0.1 First version 1.0.2 Works on multiple directories now 1.0.3 Recompiled to use msvcrt.dll, smaller executables 1.0.4 Apparently microsoft in its infinite stupidity decided that 01-jan-2002 starts on week 0 so in certain occasions the week count is off by one. As correction now 1 is extra added to the week (if needed). Dont use %W and %U in the same NewDay string as a result of this. 1.0.5 Changed FTPLogger.ini to FTPServerTools.ini, moved NewPath from [NewDay] to [Directories] 1.0.6 Added: !vfs:add for ioFTPD for today and previous days. 1.0.7 Changed: week count was one off this year due to microsoft bug. 1.0.8 Added: DaysAhead setting 1.0.9 Changed: No more need for NewPath1= NewPath2= just make more lines of NewPath= 1.0.10 Changed: Internal code changed 1.0.11 Fixed: Profile section wasnt read properly, a section of longer then 1K was skipped beyond the 1K boundary 1.1.0 Added: Creation of Symlinks for ioFTPD and shortcuts for Serv-U, these work as linked dirs, they get created or overwritten as needed. Changed:The NewPath has diseapeared and made room for a new syntax, called ToDay= and YesterDay= to support symlinks or shortcuts. 1.1.1: Changed:strtok("a||b","|") gives the same result as strtok("a|b","|") so I had to write my own StrTok. This caused some NewVFS/OldVFS settings not to go through. 1.1.2: Added:(thanks to PopWeasel) UTC/Local time setting Added:Offset to count the time ahead of time to create a new dir. 1.1.3: Changed:NewDay has now become a console program (It was a windows program). This is to make it easy to view any messages in case those should occur. 1.1.4: Fixed: Crash could occur when OldVFS was improperly assigned 1.1.5: Changed: ToDay= and YesterDay= were not flexible enough, changed it to AutoCreate=