Applicable to:
- Plesk for Linux
- Plesk for Windows
Question
A GDPR-related regulation prohibits storing clients' IP addresses on the server after a certain period of time. How to set up forced log rotation for all domains?
Answer
Use the most suitable of the available methods to set up forced log rotation for all domains at once in Plesk:
- Log into Plesk
- Go to Tools & Settings > Server Settings;
- Enable option Force daily log rotation for all domains and specify how long logs will be kept:
- Connect to the server via SSH.
-
Run the following commands to enable forced log rotation using
logrotate_forceand set the number of days usinglogrotate_period, which applies that for newly created domains and service plans only:# plesk bin settings -s logrotate_force=true
# plesk bin settings -s logrotate_period=8 -
Run the following command to apply the setting to all existing domains, where N is the number of files to keep:
# plesk bin domain -l | while read d; do plesk bin domain -u $d --log-bytime daily --log-max-num-files N; done
-
Run the following command to update system log files rotation, where N is the number of files to keep:
# plesk sbin logrot_mng --system-logs --period-type=by_time --period=daily --rot-count=N
- Connect to the server via RDP
- Open the Windows Command Prompt as Administrator
-
Run the following commands to enable forced log rotation using
logrotate_forceand set the number of days usinglogrotate_period, which applies that for newly created domains and service plans only:C:\> plesk bin settings -s logrotate_force=true
C:\> plesk bin settings -s logrotate_period=8
-
Run the following command to apply the setting to all existing domains, where N is the number of files to keep:
C:\> for /f "delims=" %d in ('plesk bin domain -l') do plesk bin domain -u "%d" -log-bytime daily -log-max-num-files N
Comments
Please sign in to leave a comment.