missing back restore doc, and clear_attendance flag

This commit is contained in:
Arturo Hernandez 2018-09-03 17:53:04 -04:00
parent e5e6a65f3c
commit 84e4d98eb1
3 changed files with 36 additions and 0 deletions

BIN
- Normal file

Binary file not shown.

View File

@ -249,6 +249,37 @@ optional arguments:
```
Backup/Restore (Users and fingers only!!!) (WARNING! destructive test! do it at your own risk!)
```sh
usage: ./test_backup_restore.py [-h] [-a ADDRESS] [-p PORT] [-T TIMEOUT]
[-P PASSWORD] [-f] [-v] [-r]
[filename]
ZK Basic Backup/Restore Tool
positional arguments:
filename backup filename (default [serialnumber].bak)
optional arguments:
-h, --help show this help message and exit
-a ADDRESS, --address ADDRESS
ZK device Address [192.168.1.201]
-p PORT, --port PORT ZK device port [4370]
-T TIMEOUT, --timeout TIMEOUT
Default [10] seconds (0: disable timeout)
-P PASSWORD, --password PASSWORD
Device code/password
-f, --force-udp Force UDP communication
-v, --verbose Print debug information
-r, --restore Restore from backup
-c, --clear-attendance
On Restore, also clears the attendance [default keep
attendance]
```
to restore on a different device, make sure to specify the `filename`. on restoring, it asks for the serial number of the destination device (to make sure it was correct, as it deletes all data) WARNING. there is no way to restore attendance data, you can keep it or clear it, but once cleared, there is no way to restore it.
# Compatible devices
```

View File

@ -38,6 +38,8 @@ parser.add_argument('-v', '--verbose', action="store_true",
help='Print debug information')
parser.add_argument('-r', '--restore', action="store_true",
help='Restore from backup')
parser.add_argument('-c', '--clear-attendance', action="store_true",
help='On Restore, also clears the attendance [default keep attendance]')
parser.add_argument('filename', nargs='?',
help='backup filename (default [serialnumber].bak)', default='')
@ -106,6 +108,9 @@ try:
conn.disable_device()
print ('Erasing device...')
conn.clear_data()
if args.clear_attendance:
print ('Clearing attendance too!')
conn.clear_attendance()
print ('Restoring Data...')
for u in data['users']:
#look for Templates