Discussion:
executing a command based on time
(too old to reply)
John R. Sowden
2010-12-15 02:35:24 UTC
Permalink
My application is this: our day shift with higher security clearance
goes home at about 17:00. She does not always log out (via an
encrypted database program using foxpro in a manner similar to linux).
The next shift does not have the security level that she does, nor do
I want them to perform tasks that are logged into a database showing
that the day person did them. I want to test the time, and take
action as a background task. the following works but I would have to
constantly be executing the command:

iff "%_time" gt "17:00" then
echo Time to go home.
else
echo Get back to work.
endiff

John
Klaus Meinhard
2010-12-15 07:46:05 UTC
Permalink
Hallo John,
Post by John R. Sowden
My application is this: our day shift with higher security clearance
goes home at about 17:00. She does not always log out (via an
encrypted database program using foxpro in a manner similar to
linux). The next shift does not have the security level that she
does, nor do I want them to perform tasks that are logged into a
database showing that the day person did them. I want to test the
time, and take action as a background task. the following works
iff "%_time" gt "17:00" then
echo Time to go home.
else
echo Get back to work.
endiff
Using only 4DOS (or 4NT, TCC, you don't write what CP or OS you are
using) you could program a loop using DO, e.g.

DO FOREVER
IFF "%_time" lt "17:00" THEN
DELAY 60
ELSE
ECHO Time to go home
QUIT
ENDIFF
ENDDO

or, without the need to have a batch continously run, you might take a
look at the task scheduler of your OS.
--
Best Regards,

* Klaus Meinhard *
<www.4dos.info>
E. S. Fabian
2010-12-15 15:58:20 UTC
Permalink
---- Message ----
From: Klaus Meinhard
| Hallo John,
|
|| My application is this: our day shift with higher security clearance
|| goes home at about 17:00. She does not always log out (via an
|| encrypted database program using foxpro in a manner similar to
|| linux). The next shift does not have the security level that she
|| does, nor do I want them to perform tasks that are logged into a
|| database showing that the day person did them. I want to test the
|| time, and take action as a background task. the following works
|| but I would have to constantly be executing the command:
||
|| iff "%_time" gt "17:00" then
|| echo Time to go home.
|| else
|| echo Get back to work.
|| endiff
|
| Using only 4DOS (or 4NT, TCC, you don't write what CP or OS you are
| using) you could program a loop using DO, e.g.
|
| DO FOREVER
| IFF "%_time" lt "17:00" THEN
| DELAY 60
| ELSE
| ECHO Time to go home
| QUIT
| ENDIFF
| ENDDO
|
| or, without the need to have a batch continously run, you might take a
| look at the task scheduler of your OS.

---- End Message ----
Hello John!
You should check to see if your login system includes automatic logout
for inactivity. Most secure systems include a feature that users inactive
for a selected time are automatically logged out. If your system includes
such a feature, turn it on. Your person who fails to log out at end of shift
may be inconvenienced during her shift, but it would reduce the likelihood
of a security breach. OTOH, in all facilities where I ever worked, and which
had security clearance requirements, it was a serious breach of security not
to log out. Repeated infractions resulted in suspension and even
termination of security clearance. IMHO a person who fails to terminate
accessibility of a system when such access is no longer authorized is not
sufficiently security conscious to be permitted access without close
supervision.
As Klaus Meinhard wrote, your best bet is to use the scheduling features
of your (to us unknown) OS to run a process that will forcible log out the
user. Any OS where 4NT or TCC runs has such a feature. 4NT and TCC allow you
to send keystrokes to another process. This is likely to allow you to force
logging out the wayward personnel.
--
HTH, Steve
John R. Sowden
2010-12-16 03:46:59 UTC
Permalink
Thanks for the response. I am running MS-DOS 6.22 with 4DOS on some
of the computers, and I plan on shifting to Ubuntu with dosemu when I
get comfortable enough with Linux to use on other people's computers
that I must support. I assume (dangerous) that this will not be a
problem with Linux. My immediate need is with the true dos machines.
I plan on changing to freedos for the non cp portion of the os because
it supports fat32, but I do not believe that will affect my log on
issue. Re: the logon procedure, I wrote a program in foxpro which
encrypts logged in pswds and then compares them to stored pswds, so
there are no plaintext pswds on the hard drive. I also set levels of
authority, which are tested on all of the foxpro applications at the
menu level. Violation notices are sent to me via the network.


John
Post by Klaus Meinhard
Hallo John,
Post by John R. Sowden
My application is this: our day shift with higher security
clearance
Post by Klaus Meinhard
Post by John R. Sowden
goes home at about 17:00. She does not always log out (via an
encrypted database program using foxpro in a manner similar to
linux). The next shift does not have the security level that she
does, nor do I want them to perform tasks that are logged into a
database showing that the day person did them. I want to test the
time, and take action as a background task. the following works
iff "%_time" gt "17:00" then
echo Time to go home.
else
echo Get back to work.
endiff
Using only 4DOS (or 4NT, TCC, you don't write what CP or OS you are
using) you could program a loop using DO, e.g.
DO FOREVER
IFF "%_time" lt "17:00" THEN
DELAY 60
ELSE
ECHO Time to go home
QUIT
ENDIFF
ENDDO
or, without the need to have a batch continously run, you might take a
look at the task scheduler of your OS.
Michael Bednarek
2010-12-18 05:38:38 UTC
Permalink
Post by John R. Sowden
My application is this: our day shift with higher security clearance
goes home at about 17:00. She does not always log out (via an
encrypted database program using foxpro in a manner similar to linux).
The next shift does not have the security level that she does, nor do
I want them to perform tasks that are logged into a database showing
that the day person did them. I want to test the time, and take
action as a background task. the following works but I would have to
iff "%_time" gt "17:00" then
echo Time to go home.
else
echo Get back to work.
endiff
Have the user(s) in question execute a login script (4Nt batch file)
through Active Directory. In that batch file, invoke the following
4NT batch file (let's call it OffAt5.BTM):

In the login script:
START "Wait until 17:00" /MIN "%_CMDSPEC" /C OffAt5.BTM %_Date 17:00:00

In OffAt5.BTM:
@*ECHO OFF
*WINDOW TRAY
*DELAY %@Eval[%@Date[%1] * 86400 + %@Time[%2] - %@Date[%_Date] * 86400 - %@Time[%_Time]]
*Reboot /L

The case of a user logging in between 17:00 and 00:00 is left as an exercise
for the reader.
--
Michael Bednarek http://mbednarek.com/ "POST NO BILLS"
John R. Sowden
2010-12-18 17:26:41 UTC
Permalink
We are running MS-DOS 6.22 with cp of 4DOS. We do not use windows os
except on standalone computers with vertical market packages that
require windows. We also use Linux on some pcs (mine) but I am not
concerned about log in with the Linux boxes. We will move from MS-DOS
6.22/4DOS to Linux/Dosemyu as I become more confident in my ability to
support the users under Linux.

John
On Tue, 14 Dec 2010 18:35:24 -0800, John R. Sowden wrote in
Post by John R. Sowden
My application is this: our day shift with higher security clearance
goes home at about 17:00. She does not always log out (via an
encrypted database program using foxpro in a manner similar to
linux).
Post by John R. Sowden
The next shift does not have the security level that she does, nor do
I want them to perform tasks that are logged into a database showing
that the day person did them. I want to test the time, and take
action as a background task. the following works but I would have to
iff "%_time" gt "17:00" then
echo Time to go home.
else
echo Get back to work.
endiff
Have the user(s) in question execute a login script (4Nt batch file)
through Active Directory. In that batch file, invoke the following
START "Wait until 17:00" /MIN "%_CMDSPEC" /C OffAt5.BTM %_Date 17:00:00
@*ECHO OFF
*WINDOW TRAY
86400 -
The case of a user logging in between 17:00 and 00:00 is left as an
exercise for the reader.
Klaus Meinhard
2010-12-19 11:14:30 UTC
Permalink
Hi John,
Post by John R. Sowden
We are running MS-DOS 6.22 with cp of 4DOS.
... and you do remember that DOS is a single-task OS which can either
run your batch _or_ your application. So what you want to do here is
simply impossible. The only way to come close is to write a DOS TSR
(Terminate, Stay Resident) program that gives a reminder at 17:00 h.

Going to Linux, you'll finde the same limitation in DOSEMU. You'd have
to start it twice, once for your app, once for the batch. But Linux'
Bash Shell should give you possibilities, or the task schduler of
Linux (does it have one?) as proposed for Windows.
--
Best Regards,

* Klaus Meinhard *
<www.4dos.info>
John R. Sowden
2010-12-19 17:03:43 UTC
Permalink
I thought there was a program that did this, to automatically run a
backup program, etc. I assume that when I do it in Linux, I will do
it from the Linux end, write a short file to the dosemu filesystem, so
when a menu program is run it checks for the existence of the file and
branches to the login program, but that is down the road. Linux is
fine for me, but setting up directories with links, permissions,
groups for my little 'enterprise', is still a little rough for me yet.

John
Post by Klaus Meinhard
Hi John,
Post by John R. Sowden
We are running MS-DOS 6.22 with cp of 4DOS.
... and you do remember that DOS is a single-task OS which can
either
Post by Klaus Meinhard
run your batch _or_ your application. So what you want to do here is
simply impossible. The only way to come close is to write a DOS TSR
(Terminate, Stay Resident) program that gives a reminder at 17:00 h.
Going to Linux, you'll finde the same limitation in DOSEMU. You'd have
to start it twice, once for your app, once for the batch. But Linux'
Bash Shell should give you possibilities, or the task schduler of
Linux (does it have one?) as proposed for Windows.
Loading...