Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

backup lisp

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
E.S.7.9
846 Views, 3 Replies

backup lisp

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 ?

3 REPLIES 3
Message 2 of 4
Kent1Cooper
in reply to: E.S.7.9

 

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.

Kent Cooper, AIA
Message 3 of 4
Lee_Mac
in reply to: Kent1Cooper

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.

Message 4 of 4
dgorsman
in reply to: E.S.7.9

Save yourself some grey hair, have a look at Shadowcopy and similar software.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost