- Python 90.7%
- Shell 4.8%
- Batchfile 4.5%
| .gitignore | ||
| collectUsers.py | ||
| exclusions | ||
| getAllDevices.bat | ||
| getAllDevices.sh | ||
| README.md | ||
User collection for the RESD
getAllDevices.sh
This file is the actual script to be executed by a cron task. It gets the updated information, then runs collectUsers.py in the proper mode to save it. By default, it asks collectUsers.py to backup the users.pkl file. There is an equivalent getAllDevices.bat file for Windows users.
exclusions
exclusions is a basic text file containing serial numbers of Chromebooks we already have tracked properly. It has a serial number on each line. Case insensitive.
collectUsers.py
This file has a few modes depending on what we need. The file takes two command line arguments. First, the mode to execute in. Second, whether to create a backup of users.pkl on each run. File backup is on by default, so to disable, set the second argument to 'false'. With backups on, it will create a backups directory (if necessary), then save a copy file to it. The first argument (the mode) has these three options:
dataCollect
This argument is used by getAllDevices.sh. It tells the script to read from devices.csv and count the recent users, then save to users.pkl.
printData
This is more of a debug option. It just prints the wraw data from users.pkl.
cleanData
This option goes through the database and removes any devices that are in the exclusions file. Useful for if you get concrete data on some Chromebooks after you start running the script regularly.
exportPrimaryUsers
This will be used to export the most common user per device. It saves it to primaryUsers.csv and has the columns 'serial', 'user', and 'occurences'.