Visual LISP, AutoLISP and General Customization

Reply
Valued Contributor
E.S.7.9
Posts: 82
Registered: ‎07-03-2012
Message 1 of 4 (229 Views)
Accepted Solution

backup lisp

229 Views, 3 Replies
09-05-2013 11:01 PM

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 ?

*Expert Elite*
Kent1Cooper
Posts: 5,243
Registered: ‎09-13-2004
Message 2 of 4 (203 Views)

Re: backup lisp

09-06-2013 04:41 AM 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
*Expert Elite*
Lee_Mac
Posts: 1,109
Registered: ‎12-29-2009
Message 3 of 4 (190 Views)

Re: backup lisp

09-06-2013 06:22 AM 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.

Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)
Expert Elite
With Mathematics there is the possibility of perfect rigour, so why settle for less?
*Expert Elite*
dgorsman
Posts: 5,056
Registered: ‎10-12-2006
Message 4 of 4 (180 Views)

Re: backup lisp

09-06-2013 07:23 AM 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.
Adopt. Adapt. Overcome. Or be overcome.
A good question will be halfway to a good answer.


You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community