hi everyone ,
who can write me a code that i can able to backup my drawing file into the specific folder with date and hour drawing name , in every hour ( changable ) ,except autosave autocad function ?
example :
c:\backup\06092013_10.00.dwg
c:\backup\06092013_11.00.dwg
c:\backup\06092013_12.00.dwg
or something like that .... is there a posibility ?
Solved! Go to Solution.
Solved by Lee_Mac. Go to Solution.
Solved by Kent1Cooper. Go to Solution.
E.S.7.9 wrote:
....
who can write me a code that i can able to backup my drawing file into the specific folder with date and hour drawing name , in every hour ( changable ) ,except autosave autocad function ?
example :
c:\backup\06092013_10.00.dwg
c:\backup\06092013_11.00.dwg
c:\backup\06092013_12.00.dwg
or something like that .... is there a posibility ?
If a slightly different format for the file name is acceptable, you can get it pretty easily without needing to reformat it or combine things:
(rtos (getvar 'cdate) 2 4)
returns this format:
"20130906.0729"
[You could apply certain (vl-string...) functions to replace the period with an underscore or hyphen if you prefer.]
One advantage of that format is that files will always appear in an alphabetically-ordered listing (such as in Windows Explorer) in chronological order. In the format in your example, backups in January 2014 will appear before those from December 2013.
As for getting the backup to occur at regular times, that's trickier. Search the Discussion Group -- similar questions have been raised here before.
You can retrieve the date & time in the format required by the OP using a simple DIESEL expression, e.g.:
_$ (menucmd "m=$(edtime,0,DDMOYYYY_HH.MM)") "06092013_14.19"
As for the automatic backup - see this recent thread.
Save yourself some grey hair, have a look at Shadowcopy and similar software.