Clear Logs automatic

islam bahaz3 years ago

hello
i want to Clear Logs file automatic in /opt/traccar/logs/
i dont understand how to use this commands

cat > /etc/cron.daily/traccar-clear-logs << EOF
#!/bin/sh
find /opt/traccar/logs/ -mtime +3 -type f -delete
EOF
chmod +x /etc/cron.daily/traccar-clear-logs

please give me the way step by step

Anton Tananaev3 years ago

You just need to copy paste it into the command line.

islam bahaz3 years ago

I do it but the file is not deleted

Richard Acosta3 years ago

The issue is not related to traccar.
You need to learn a bit more about linux console commands.

jamel2 years ago

you need to change the permissions of the directory By :
sudo chmod 777 /opt/traccar/logs/