Backup between two times

  • Thread starter Thread starter Kevbro7189
  • Start date Start date
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#
 
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?
 
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?
 
In than case, Kev, I would expect a small variation on your original
COndidion to work:
Time()<#6:00:00#
 
Ok, that will work. But what if I wanted it to only work if the time was
between 8am and 10am?
 
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#
 
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
 
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.
 
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
 
Back
Top