topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Sunday December 15, 2024, 3:52 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: DONE: auto-save AutoHotkey.ini daily to another folder  (Read 9978 times)

brotherS

  • Master of Good Ideas
  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 2,261
    • View Profile
    • Donate to Member
DONE: auto-save AutoHotkey.ini daily to another folder
« on: November 23, 2005, 11:36 PM »
Hi,

I'd like to add a few lines to my main AHK script (that's running 24/7) that will copy this script to another partition but with the name AutoHotkey-YYYY-MM-DD.ini (so for today it would be AutoHotkey-2005-11-24.ini) once a day only - so I'd get one copy for every day the PC is running.

Any ideas? Maybe this could be somehow combined with the auto-reload on save script?

;2005-11-23
;auto-reloads the AHK script
;http://www.autohotkey.com/forum/viewtopic.php?t=135&highlight=auto+reload
$^s::
  Send, ^s
  SetTitleMatchMode, 2
  IfWinActive, AutoHotkey.ini
    {
       TrayTip, AutoHotkey, reloading script...
       SetTimer, RemoveTrayTip, 1500
     }
return

RemoveTrayTip:
    SetTimer, RemoveTrayTip, Off
    TrayTip
    Reload
return
;http://www.autohotkey.com/forum/viewtopic.php?t=135&highlight=auto+reload


mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: IDEA: auto-save AutoHotkey.ini daily to another folder
« Reply #1 on: November 24, 2005, 12:21 AM »
very useful idea.
can i suggest two additional features:
1) dont make a new backup file for the day if its identical to the last one.
2) zip it when making backup (in this case you wouldnt have to add date to file, just to zip).

brotherS

  • Master of Good Ideas
  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 2,261
    • View Profile
    • Donate to Member
Re: IDEA: auto-save AutoHotkey.ini daily to another folder
« Reply #2 on: November 24, 2005, 04:30 AM »
I didn't suggest option 1) because I want it to be as fast as possible, but I like your suggestion 2)!

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: IDEA: auto-save AutoHotkey.ini daily to another folder
« Reply #3 on: November 24, 2005, 10:40 AM »
 :) How about something along the lines of

SetTimer,BACKUP,60000

BACKUP:
IfNotExist,D:\AutoHotkey-%A_YYYY%-%A_MM%-%A_DD%.ini
  FileCopy,C:\AutoHotkey.ini,D:\AutoHotkey-%A_YYYY%-%A_MM%-%A_DD%.ini
Return

Skrommel
« Last Edit: November 24, 2005, 07:12 PM by skrommel »

brotherS

  • Master of Good Ideas
  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 2,261
    • View Profile
    • Donate to Member
Re: IDEA: auto-save AutoHotkey.ini daily to another folder
« Reply #4 on: November 24, 2005, 04:01 PM »
:) How about something along the lines of
[...]
clean and simple solution, thanks! :)

brotherS

  • Master of Good Ideas
  • Honorary Member
  • Joined in 2005
  • **
  • Posts: 2,261
    • View Profile
    • Donate to Member
Re: IDEA: auto-save AutoHotkey.ini daily to another folder
« Reply #5 on: November 25, 2005, 01:54 AM »
Hmm, very strange:

At 23:07, while we still had the 24th, it created this file:
AutoHotkey-2005-11-25

EDIT:
Err, probably it is working just fine, I was just confused by the fact that the file date wasn't changed when copied, but that's good, I just have to get used to it :D
« Last Edit: November 25, 2005, 01:56 AM by brotherS »