Create a Bash script named log_cleanup.sh
that does the following:
- It searches for log files (*.log) older than 7 days in a specified directory
/var/log/nginx/
. - It moves these older log files to an archive directory
/var/log/archive/
. - Ensure the script logs its activities in a separate log file located at
/var/log/log_cleanup_activity.log
. - Make sure the script is executable and handles scenarios like empty directories or absence of log files.