Jump to content
Sign in to follow this  

Grandfather, father, Son

Recommended Posts

My first autoit script so be gentle, it's not had a lot of testing yet either so please report any bugs you find:

gfs script (v0.2.1)

gfs compiled exe (v0.2.1)

Script version:


Script Function:

Grandfather, father, son file renaming


Will rename the specified input file by adding the day of the week to its name. If the day is a friday

the number of the friday of the month will be added. If it is friday 4 the month will also be added.

Storing just 21 files will give you a years worth of backups. You will always have the last week, a backup

for each of the last 4 weeks and a backup per month for the last 12 months.


Monday: file.zip -> Mon-file.zip

Tuesday: file.zip -> Tue-file.zip

1st Friday of month: file.zip -> Fri-1-file.zip

2nd Friday of month: file.zip -> Fri-2-file.zip

4th Friday of January: file.zip -> Fri-4-1-file.zip

4th Friday of February: file.zip -> Fri-4-2-file.zip


Call script once without command line arguments to generate a default gfs.ini file in current directory

Call script with a file name as the first argument to rename that file according to the current date

Call script with an ini file name as the second command line argument to use a specific ini file

Using the ini file from the current directory:

gfs.exe C:\files\file_to_be_renamed.zip

Specifying an ini file:

gfs.exe C:\files\file_to_be_renamed.zip C:\config\gfs.ini

EDIT: Slightly updated as friday 4 calculation was off

Edited by coptang

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Create New...