Skip to main content

Removing all data from logfiles that is older than x days for GDPR compliance

Intent

Regulations in GDPR foresee an age limit to all data that is kept in any given system. 

These scripts are meant to allow you to make sure you keep no log data older than a number of days as defined by yourself in any of the filewave system's logfiles. 

Server Logfile Cleanup script

Download:  clean-fwxserver-logfiles.py

Testing the script / previewing effects 

Please define the number of days that information in log files should persist by modifiying the following line in the downloaded script , replacing the default 10 with the number of days you prefer (must be greater than 0):

daystokeep=10 #minimum of 1 day

Mac or Linux server - needs to be run as root 

/usr/local/filewave/python/bin/python ./clean-fwxserver-logfiles.py

The script will now tell you what files it would delete : 

DRYRUN - logfile /fwxserver/DB/pg_data/pg_log/postgresql-pre-pgbadger.log would be erased if dryrun=False

and which files it would modify , generating a preview in /tmp ( macOS or Linux based server ): 

DRYRUN - logfile content would be modified if dryrun=False; writing preview of pruned file to : /tmp/postgresql-2018-05-01_160839.log

Usage in Production

After you have verified the script works as you expect it to , replace the following line in the script :

dryrun=True

using the following line :

dryrun=False

Mac or Linux server - this script needs to be run as root - schedule a cronjob to run the script daily. Please make sure to change "/full/path/to" using the full path to the python script on the server.

/usr/local/filewave/python/bin/python /full/path/to/clean-fwxserver-logfiles.py

macOS Client Logfile Cleanup script

Download: clean-macOS-fwcld-logfiles-including-locale.py

Testing the script / previewing effects 

Please define the number of days that information in log files should persist by modifiying the following line in the downloaded script , replacing the default 10 with the number of days you prefer (must be greater than 0):

daystokeep=10 #minimum of 1 day

If you are running FileWave Client using a specific locale , please adjust the following value to the same one you are using for fwcld : 

language_locale='en_US'

macOS Client - needs to be run as root 

python ./clean-macOS-fwcld-logfiles-including-locale.py

Usage in Production

After you have verified the script works as you expect it to , replace the following line in the script :

dryrun=True

using the following line :

dryrun=False

Mac Client : Deploy the script using a fileset , as a verification script to ensure daily execution 

Windows Client Logfile Cleanup script ( TBA )