Maintenance

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.

Available Commands

Below is a list of all available maintenance commands:

Gzip Purge

Removes all compressed .gz log files from storage/logs directory to free up disk space.

artisan maintenance:gzip-purge

Journal Vacuum

Cleans systemd journal files older than 2 days using journalctl --vacuum-time=2d (requires sudo password in env)

artisan maintenance:journal-vacuum

JS Outdated

Scans and reports outdated npm packages by parsing npm outdated --json output.

artisan maintenance:js-outdated

Live

Restores the application to normal operation by switching back from the maintenance mode index file.

artisan maintenance:live

Log Archive

Archives yesterday's Laravel and scheduler logs to a backup storage disk.

artisan maintenance:log-archive

Log Purge

Removes all compressed and rotated log files (.gz and numbered files) from log (requires sudo password in env).

artisan maintenance:log-purge

Package Cleaner

Runs apt-get autoremove and apt-get autoclean to clean unused system packages (requires sudo password in env).

artisan maintenance:package-cleaner

PHP Outdated

Checks for outdated Composer packages and reports which ones can be safely updated.

artisan maintenance:php-outdated

Updating

Places the Laravel application in maintenance mode by replacing index.php with a maintenance page.

artisan maintenance:updating

Upgradable

Counts and reports the number of upgradable system packages using apt list --upgradable.

artisan maintenance:upgradable

Note

Commands requiring sudo need the SUDO_PW environment variable set with your sudo password.