[Turn off line numbering]
1: arg @args;
2: var line, who, how, name, dirty;
3:
4: (> .perms(sender(), 'system) <);
5: if (dict_contains(backup, 'started)) {
6: .log("BACKUP CONFLICT");
7: line = "BACKUP CONFLICT at " + $time.format("%r");
8: line += ", Current backup started at " + $time.format("%r", backup['started]);
9: $channel_ui._broadcast('System, line);
10: return;
11: }
12: dirty = .dirty();
13: [(who ?= sender()), (how ?= 'request)] = args;
14: if (!valid(who))
15: who = sender();
16: backup = backup.add('next, time() + backup['interval]);
17: backup = backup.add('last, time());
18: if (how == 'interval && !dirty)
19: return;
20: catch any {
21: name = who.namef('ref);
22: .log("BACKUP (" + name + ") ");
23: line = "Backup started at " + $time.format("%r") + " by " + name;
24: $channel_ui._broadcast('System, line);
25: }
26:
27: // double pause will hopefully let people know about it before it happens
28: pause();
29: pause();
30: backup = backup.add('started, time());
31: (> backup() <);
["// Created 26-Mar-1995 as a part of ColdCore, see: @help Credit"]