missing back restore doc, and clear_attendance flag
This commit is contained in:
parent
e5e6a65f3c
commit
84e4d98eb1
31
README.md
31
README.md
@ -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
|
# Compatible devices
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -38,6 +38,8 @@ parser.add_argument('-v', '--verbose', action="store_true",
|
|||||||
help='Print debug information')
|
help='Print debug information')
|
||||||
parser.add_argument('-r', '--restore', action="store_true",
|
parser.add_argument('-r', '--restore', action="store_true",
|
||||||
help='Restore from backup')
|
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='?',
|
parser.add_argument('filename', nargs='?',
|
||||||
help='backup filename (default [serialnumber].bak)', default='')
|
help='backup filename (default [serialnumber].bak)', default='')
|
||||||
|
|
||||||
@ -106,6 +108,9 @@ try:
|
|||||||
conn.disable_device()
|
conn.disable_device()
|
||||||
print ('Erasing device...')
|
print ('Erasing device...')
|
||||||
conn.clear_data()
|
conn.clear_data()
|
||||||
|
if args.clear_attendance:
|
||||||
|
print ('Clearing attendance too!')
|
||||||
|
conn.clear_attendance()
|
||||||
print ('Restoring Data...')
|
print ('Restoring Data...')
|
||||||
for u in data['users']:
|
for u in data['users']:
|
||||||
#look for Templates
|
#look for Templates
|
||||||
|
Loading…
Reference in New Issue
Block a user