The Maintenance package is a collection of commands to help with app maintenance. This package has commands which can help delete old logs, and system leftovers which can eat up server space over time.
Below is a list of all available maintenance commands:
Removes all compressed .gz log files from storage/logs directory to free up disk space.
artisan maintenance:gzip-purge
Cleans systemd journal files older than 2 days using journalctl --vacuum-time=2d (requires sudo password in env)
artisan maintenance:journal-vacuum
Scans and reports outdated npm packages by parsing npm outdated --json output.
artisan maintenance:js-outdated
Restores the application to normal operation by switching back from the maintenance mode index file.
artisan maintenance:live
Archives yesterday's Laravel and scheduler logs to a backup storage disk.
artisan maintenance:log-archive
Removes all compressed and rotated log files (.gz and numbered files) from log (requires sudo password in env).
artisan maintenance:log-purge
Runs apt-get autoremove and apt-get autoclean to clean unused system packages (requires sudo password in env).
artisan maintenance:package-cleaner
Checks for outdated Composer packages and reports which ones can be safely updated.
artisan maintenance:php-outdated
Places the Laravel application in maintenance mode by replacing index.php with a maintenance page.
artisan maintenance:updating
Counts and reports the number of upgradable system packages using apt list --upgradable.
artisan maintenance:upgradable
Commands requiring sudo need the SUDO_PW environment variable set with your sudo password.