As my disk space is less , i would need to zip and archive the logs in another directory which are older than 30 days.
Can someone please modify the below command to zip the 30 days older files and move it to destination folder.
find . -name 'server.log*' -mtime +30 -exec zip -r /home/user/Logs/ /opt/apps/log {} \;
where server.log
is a log file and there will be many logs with datestamp attached like this server.log_290719
.
/home/user/Logs
is destination folder and /opt/apps/log
is source folder.
sudo /etc/cron.daily/logrotate
then movegz
created files. FYI there are some other files taking a lot of space on root partition. Think snap old packages, old kernels and apt cache See https://askubuntu.com/a/1161181/77093 – cmak.fr Jul 29 '19 at 07:41