-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathHousekeeping.cmd.sample
More file actions
11 lines (10 loc) · 1.25 KB
/
Housekeeping.cmd.sample
File metadata and controls
11 lines (10 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
@rem (Base function) purges old rows from history
set PGPASSWORD=pw
"C:\Program Files (x86)\PostgreSQL\9.6\bin\psql.exe" -d Jvakt -U Jvakt -c "select * from consolehst where credat < now()::date - 31;" > c:\JavaSrc\Housekeeping.log
"C:\Program Files (x86)\PostgreSQL\9.6\bin\psql.exe" -d Jvakt -U Jvakt -c "delete from consolehst where credat < now()::date - 31;" >> c:\JavaSrc\Housekeeping.log
"C:\Program Files (x86)\PostgreSQL\9.6\bin\psql.exe" -d Jvakt -U Jvakt -c "select * from status where type = 'D';" >> c:\JavaSrc\Housekeeping.log
"C:\Program Files (x86)\PostgreSQL\9.6\bin\psql.exe" -d Jvakt -U Jvakt -c "delete from status where type = 'D';" >> c:\JavaSrc\Housekeeping.log
"C:\Program Files (x86)\PostgreSQL\9.6\bin\psql.exe" -d Jvakt -U Jvakt -c "delete from logs where credat < now()::date - 1;" >> c:\JavaSrc\Housekeeping.log
@rem (Base function) nullify recid to remove the Ivanti connections.
@rem "C:\Program Files\PostgreSQL\13\bin\psql.exe" -d Jvakt -U Jvakt -c "select * from console where recid is not null and credat <= current_timestamp - interval '1 hour';"
@rem "C:\Program Files\PostgreSQL\13\bin\psql.exe" -d Jvakt -U Jvakt -c "update console set recid=null where recid is not null and credat <= current_timestamp - interval '1 hour';"