Results 1 to 8 of 8
  1. #1
    radian89 is offline Advanced Beginner
    Windows 7 32bit Access 2016
    Join Date
    Dec 2015
    Posts
    37

    Best Backup Method, for Back End database by Weekly/Monthly


    Hi All,

    I've read and digging articles & forums related with backup periodically, but i still have no clue. I want to periodically & automatically backup my back end database (My database is splitted), by weekly or monthly.

    Option 1
    some reading suggest back it up (means simply copy it) using windows task scheduler, the script is,

    Code:
    copy /Y d:\apps\databases\mydatabase.accdb z:\backups\databases\*.*
    
    
    http://dba.stackexchange.com/questio...e-daily-weekly

    but seems not working i'm literally copy from " copy /Y d:\apps\databases\mydatabase.accdb z:\backups\databases\*.* "

    my source is from

    D:\My Document\Kerjaan\freelancer\Access\Database\Databa se v2_be.accdb

    backup destination

    D:\My Document\Kerjaan\freelancer\Access\Database\backup \

    I'm using create basic task wizard for this.

    Option 2
    like mikeperris suggestion, create new table bout the backup, running autoexec vba, but it backup daily based on open file, and it doesn't explain for split database backup.

    http://mikeperris.com/access/automat...vba-macro.html

    Option 3
    have any option to do it? with simple steps? I'm bit blind about vba code here



    thanks a lot for the help,
    warm regards

  2. #2
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    First, I wonder if your network IT does not do nightly backups, and are you backing up the FE or BE?

    copy /Y d:\apps\databases\mydatabase.accdb z:\backups\databases\*.*
    As for the first example, where's the rest of the code? This is only part of a batch (cmd) file. It looks like you think it is a line you can just plunk into the shortcut property, but I might be wrong about your thoughts.

    You have several options, the simplest of which may be to use Task Scheduler to run a batch or command file (.bat or .cmd). The following is what I used to backup a BE by opening the batch file with Task Scheduler.
    NOTE: The batch file has to be in the same folder as the file being backed up. It copies the BE as BE_BAK. If you don't like those options, edit to suit. Copy and dump the code into Notepad and save with the extension .bat (obviously, this goes a the end of your batch file name).
    safeguard against unwanted over-writes before experimenting with this - it does not give you an opportunity to change your mind.

    Code:
    rem to copy TheDatabase_be to backup database
    rem must be run from this folder
    
    cls
    @echo off
    
    rem next line sets directory to current location, but uses the assigned
    rem assigned drive letter (e.g. F, L, etc.) for users whose home drive
    rem letter is not the same as the db folder
    
    set MyDir=%~dp0
    
    rem now use that value by reference
    cd %MyDir%
    
    :CopyFiles
    rem folders with spaces in path (BAD) requires use of quotes around paths
    
    copy "%MyDir%TheDatabase_be.mdb" "%MyDir%TheDatabase_be_Bak.mdb" /y
    
    :quit
    exit

    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    radian89 is offline Advanced Beginner
    Windows 7 32bit Access 2016
    Join Date
    Dec 2015
    Posts
    37
    Quote Originally Posted by Micron View Post
    First, I wonder if your network IT does not do nightly backups, and are you backing up the FE or BE?

    copy /Y d:\apps\databases\mydatabase.accdb z:\backups\databases\*.*
    As for the first example, where's the rest of the code? This is only part of a batch (cmd) file. It looks like you think it is a line you can just plunk into the shortcut property, but I might be wrong about your thoughts.

    You have several options, the simplest of which may be to use Task Scheduler to run a batch or command file (.bat or .cmd). The following is what I used to backup a BE by opening the batch file with Task Scheduler.
    NOTE: The batch file has to be in the same folder as the file being backed up. It copies the BE as BE_BAK. If you don't like those options, edit to suit. Copy and dump the code into Notepad and save with the extension .bat (obviously, this goes a the end of your batch file name).
    safeguard against unwanted over-writes before experimenting with this - it does not give you an opportunity to change your mind.

    Code:
    rem to copy TheDatabase_be to backup database
    rem must be run from this folder
    
    cls
    @echo off
    
    rem next line sets directory to current location, but uses the assigned
    rem assigned drive letter (e.g. F, L, etc.) for users whose home drive
    rem letter is not the same as the db folder
    
    set MyDir=%~dp0
    
    rem now use that value by reference
    cd %MyDir%
    
    :CopyFiles
    rem folders with spaces in path (BAD) requires use of quotes around paths
    
    copy "%MyDir%TheDatabase_be.mdb" "%MyDir%TheDatabase_be_Bak.mdb" /y
    
    :quit
    exit


    Hi Micron,

    I'm backup BE, so how do i use the task scheduler? can you help me guide or give example of the code? and where to put it?

    I'm don't really understand coding at all

    does

    Code:
    rem next line sets directory to current location, but uses the assigned
    rem assigned drive letter (e.g. F, L, etc.) for users whose home drive
    rem letter is not the same as the db folder
    is code?

    thanks a lot for the help
    warm regards,

  4. #4
    Jen0dorf is offline Competent Performer
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    UK
    Posts
    453
    HI

    I'm an access newbie but backups are something I've had experience with.

    First question to ask is how vital is your information
    Second is how often does it change
    THird question is the database used 24*7

    If your data is vital then backups need to be often

    every MOnday Full backuo
    every tuesday, wednesday etc incremental backup
    Every MOnday Weekly backup
    Every month a monthly backup

    If you keep three sets of storage and rotate them then the most you can lose is one day.

    If the data changes constantly I'd schedule more full backups.

    Lastly if you data is used 24/7 then you need a backup regime that handles open files.

    http://www.easeus.com/ do some simple software

    Symantec backupexec is one could argue the best.


    Doing backups is great but not just because they are scheduled assume all is well.

    Every month make a point of doing a trial restore to an alternate location - I've had clients who thought the backups were viable when they were not!!


    Alternatively as has been suggested contact your IT dept and get them to add you data to thier backup regime

    HTH

    Ian

  5. #5
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Quote Originally Posted by radian89 View Post
    Hi Micron,
    I'm backup BE, so how do i use the task scheduler? can you help me guide or give example of the code? and where to put it?
    I'm don't really understand coding at all
    What you ask for (bolded above) is in my post. Please re-read my post, especially:

    Copy and dump the code into Notepad and save with the extension .bat (obviously, this goes a the end of your batch file name).
    Everything I posted within the code panel/window is "the code".

    The batch file has to be in the same folder as the file being backed up.

    The location for the batch file was specified.

    I used TS but by no means am I an expert and I don't have it available to me now, so please Google/research
    - Windows Task Scheduler on how to use. It will be well documented and makes little sense to recreate the info here. All you need it to do, should you choose this method, is to have TS open the batch file.
    - how to make a batch file (although I have already posted how to do this).
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  6. #6
    radian89 is offline Advanced Beginner
    Windows 7 32bit Access 2016
    Join Date
    Dec 2015
    Posts
    37
    Quote Originally Posted by Micron View Post
    What you ask for (bolded above) is in my post. Please re-read my post, especially:

    Copy and dump the code into Notepad and save with the extension .bat (obviously, this goes a the end of your batch file name).
    Everything I posted within the code panel/window is "the code".

    The batch file has to be in the same folder as the file being backed up.

    The location for the batch file was specified.

    I used TS but by no means am I an expert and I don't have it available to me now, so please Google/research
    - Windows Task Scheduler on how to use. It will be well documented and makes little sense to recreate the info here. All you need it to do, should you choose this method, is to have TS open the batch file.
    - how to make a batch file (although I have already posted how to do this).
    Hi Micron,

    sorry for late in reply, yesterday was pretty hectic.
    I've done as your guide, copy the code & save it as .Bat

    here's my directory D:\My Document\Kerjaan\freelancer\Access\Database\ and the screenshot .bat in the same folder.
    I adjust the code to refer the name of my file

    Code:
    "%MyDir%TheDatabase_be.mdb" "%MyDir%TheDatabase_be_Bak.mdb" /y
    become

    Code:
    copy "%MyDir%Database v2_be.accdb" "%MyDir%Database v2_be_Bak.accdb" /y
    Click image for larger version. 

Name:	Capture.JPG 
Views:	22 
Size:	14.6 KB 
ID:	23502

    and here's is the screenshot of task scheduler

    Click image for larger version. 

Name:	Capture2.JPG 
Views:	24 
Size:	56.8 KB 
ID:	23503

    and it works, creating _bak
    Click image for larger version. 

Name:	Capture3.JPG 
Views:	24 
Size:	18.0 KB 
ID:	23504.

    thanks a lot for the help Micron
    warm regards

  7. #7
    radian89 is offline Advanced Beginner
    Windows 7 32bit Access 2016
    Join Date
    Dec 2015
    Posts
    37
    Quote Originally Posted by Jen0dorf View Post
    HI

    I'm an access newbie but backups are something I've had experience with.

    First question to ask is how vital is your information
    Second is how often does it change
    THird question is the database used 24*7

    If your data is vital then backups need to be often

    every MOnday Full backuo
    every tuesday, wednesday etc incremental backup
    Every MOnday Weekly backup
    Every month a monthly backup

    If you keep three sets of storage and rotate them then the most you can lose is one day.

    If the data changes constantly I'd schedule more full backups.

    Lastly if you data is used 24/7 then you need a backup regime that handles open files.

    http://www.easeus.com/ do some simple software

    Symantec backupexec is one could argue the best.


    Doing backups is great but not just because they are scheduled assume all is well.

    Every month make a point of doing a trial restore to an alternate location - I've had clients who thought the backups were viable when they were not!!


    Alternatively as has been suggested contact your IT dept and get them to add you data to thier backup regime

    HTH

    Ian
    Hi Ian.

    Sorry for late reply, thanks a lot for the advice & exp share, answering your question in blue :

    First question to ask is how vital is your information, it's pretty much vital, but not really great urgent, it's just a preventive action for mishappening. it's only backup the table, not the forms or query or report (for now i think)
    Second is how often does it change, the change is pretty much every day in weekday. because the database is for a store
    THird question is the database used 24*7, nope, it's only use on work hour, in weekday, mon-sat possibly

    i've creating backup on everyday, based on Micron suggestion, unless encountering major problem, i think it's good for now.

    thanks a lot for the link.

    Warm regards,

    Adrian


  8. #8
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    @radian89; glad you got it working.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Backup database
    By mathhero in forum Access
    Replies: 2
    Last Post: 10-30-2015, 04:49 AM
  2. Monthly report with weekly totaSs
    By Alex Motilal in forum Reports
    Replies: 3
    Last Post: 09-27-2015, 10:26 AM
  3. Replies: 1
    Last Post: 05-30-2013, 11:29 PM
  4. Replies: 1
    Last Post: 06-22-2011, 07:55 PM
  5. Is weekly / monthly automation possible?
    By 10 Gauge in forum Access
    Replies: 4
    Last Post: 03-17-2011, 07:23 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums