Backing up files.

Do to SS4 crashing frequently, I am looking for a macro that we can run either manually or at frequent times to keep a good copy thru out the day of the file that we are working on at any given time. We are currently using the command line key in with the following format: Backup Filename_Date_Time.dgn. Example: dsgnrd01.dgn would be backed up as Backup dsgnrd01_20151105_1139.dgn. At the end of the day, we delete all but the newest one. My thinking is to incorporate it into the menu of the mouse so that the user can right click and select Backup and have the rest fill in for them. In addition a MDL that ran at startup that backed up every 30 minutes or hour.

Anyone have a suggestion?

  • Terry,
    Great suggestions.
    I do the same, but a little different.
    I placed a batch file in the "Send To" folder so I just right mouse click on a folder to back it up.
    I use %1 as the source.
    I use Xcopy and the /M switch to copy only things that have changed.
    I do hard code the destination folder as C:\ProjectBackup
    I also capture the project number in the source path and add it to the destination path.
    The final backup looks like this:
    C:\ProjectBackup\projectnumber\*.*
    So next time you run it it will only copy changed files, but to the same destination folder.
    You could also use your date routine for folder naming if desired.
    I worry about drive space since most users are data hogs and would run the backup daily (if not hourly). HaHa
  • I should also mention that this makes time and date folders and does not change the file names... I can also just run it manually or use scheduler. They only downside is I have to manually edit the working folder location or make a batch file for each project. It is a bit of a duct tape and bailing wire solution but it does work. :-)
  • Mitch,

    I have a .bat file that I call every hour with Task Scheduler (built into Windows). Here is the text:

    @echo off

    set date_=%date:/=-%

    set source=I:\TPA\PRJ\000007318\7318_CobbRoad\25729925201\roadway\working\3D Modeling

    set destin=C:\DATA\!Backups\%date_%

    For /f "tokens=1-2 delims=/:" %%a in ('time /t') do (set mytime=%%a%%b)

    Set Incrimfolder="%destin%\%mytime%"

    robocopy "%source%" %Incrimfolder% /s /z /r:3 /w:10 /maxage:15

    pause

    "set source" is the project working folder, which I manually edit when I am working on a different projects. "set Destin" is a folder where I keep all the the time and data stamped bakups. This version only makes a copy of the files in the folder that have changed in the last 15 days ( /maxage:15).

    I am using the Windows RoboCopy utility to accomplish this. You can learn more about RoboCopy and the syntax here:

    ss64.com/.../robocopy.html

    and here:

    en.wikipedia.org/.../Robocopy

    Cheers,

    Terry