Revision 26024,
577 bytes
checked in by jdreed, 11 years ago
(diff) |
In moira:
* Snapshot moira at r4113 to pick up new firewall-related changes
|
Rev | Line | |
---|
[26024] | 1 | #!/moira/bin/perl -Tw |
---|
| 2 | # $Id$ |
---|
| 3 | |
---|
| 4 | use DBI; |
---|
| 5 | |
---|
| 6 | $moira = DBI->connect("dbi:Oracle:moira", "moira", "moira", |
---|
| 7 | { RaiseError => 1}); |
---|
| 8 | |
---|
| 9 | $tnow = localtime; |
---|
| 10 | print "Beginning at $tnow\n"; |
---|
| 11 | |
---|
| 12 | ($count) = $moira->selectrow_array("SELECT count(*) FROM users WHERE xmodtime < SYSDATE - 2"); |
---|
| 13 | |
---|
| 14 | $sth = $moira->prepare("UPDATE users SET affiliation_basic = 'affiliate', affiliation_detailed = 'MIT Affiliate' " . |
---|
| 15 | "WHERE xmodtime < SYSDATE - 2"); |
---|
| 16 | $sth->execute; |
---|
| 17 | |
---|
| 18 | print "Updated $count records.\n"; |
---|
| 19 | |
---|
| 20 | $tnow = localtime; |
---|
| 21 | print "Ending at $tnow\n"; |
---|
| 22 | |
---|
| 23 | $moira->disconnect; |
---|
| 24 | exit(0); |
---|
Note: See
TracBrowser
for help on using the repository browser.