/* This is an Arexx script which you can use from a cron to optimize spot area */
/* Cleanup.spot Version 1.1 © 1993 by Benoit Mortier                           */
/*																																						 */
/* For comments, remarks, bugs, etc. contact:                               	 */
/* Fidonet: 2:291/715.4                                                     	 */
/* UUCP: mortier@mortier.adsp.sub.org																					 */
/*																																						 */
/* the only thing you have to change is the path of your logfile							 */

options results
address spot

if ~show(Libraries,'rexxsupport.library') then
    if ~addlib("rexxsupport.library",0,-30,0) then exit

log = "logs:spot.log"

open(logfile,log,'A')

call getdate

call writeln(logfile,'! 'date' 'time'  Maintenance')

'maintenance QUIET NOREQ KEEPUNREAD'

call getdate

call writeln(logfile,'! 'date' 'time'  Optimize')

close(logfile)

'optimize QUIET NOREQ'

exit

getdate:
address command 'date >t:date'

open(mydate,'t:date','R')
	today = readln(mydate)
	date = subword(today,2,1)
	time = subword(today,3,1)
close(mydate)

delete(mydate)
return
