Backup between two times

K

Kevbro7189

I have a program that performs a backup automatically. But I want it to only
back up between 12pm and 6am. Currently it will back up if the time is <12pm.

How should the condition look to only backup between 12pm and 6am?
Current Condition:
Time()<#12:00:00 PM#
 
S

Steve Schapel

Kev,

Do you mean between 12 noon and 6am the following morning? So it will *not*
backup between 6am and noon? So 18 hours where the backup is on, and 6
hours it is off?
 
K

Kevbro7189

Sorry, I meant 12am to 6am....

Steve Schapel said:
Kev,

Do you mean between 12 noon and 6am the following morning? So it will *not*
backup between 6am and noon? So 18 hours where the backup is on, and 6
hours it is off?
 
S

Steve Schapel

In than case, Kev, I would expect a small variation on your original
COndidion to work:
Time()<#6:00:00#
 
K

Kevbro7189

Ok, that will work. But what if I wanted it to only work if the time was
between 8am and 10am?
 
S

Steve Schapel

Kev,

Time()>#8:00:00# And Time()<#10:00:00#

or, if you want to include when it is exactly the times at the end of the
range...
Time()>=#8:00:00# And Time()<=#10:00:00#

or...
Time() Between #8:00:00# And #10:00:00#
 
C

Clifford Bass

Hi,

I won't duplicate Steve's good answers. But I am wondering how you are
triggering the backup? And, if it should only be run once per day, how you
are preventing it from running more than once?

Clifford Bass
 
K

Kevbro7189

When the user closes the app. it runs a macro to back it up, then shuts down
the app. If it's shut down more than once during that time frame it writes
over the previous data. So to ensure data isn't lost I have the app backing
up to 4 different files based on time. 6 to 12 will be one file 12 to 6 will
be another and so on.
 
C

Clifford Bass

Hi Kev,

I would think that would work if the backups themselves are getting
backed up to somewhere else that does not get overwriten--perhaps nightly--so
that you have a history. Otherwise if there is corruption and it is not
discovered until a day later, there could be a problem.

One way that I trigger certain backups is using the Windows task
scheduler. This runs, as long as the machine is on, regardless of someone
being logged in or not and has a number of options for error conditions. It
may or may not be suitable for your situation.

Clifford Bass
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top