这是indexloc提供的服务,不要输入任何密码

Configuring Alerts & Backups

Starting from Snipe-IT v3.0, all automated tasks are handled via the scheduler. To set a cron job to run every minute to ping the scheduler:

* * * * * /path/to/php /path/to/artisan schedule:run >> /dev/null 2>&1

The scheduler already knows how often it should trigger the individual tasks, because of this code in the Console Kernel:

$schedule->command('snipeit:expiring-alerts')->daily();
$schedule->command('snipeit:inventory-alerts')->daily();
$schedule->command('snipeit:backup')->weekly();
$schedule->command('backup:clean')->daily();
$schedule->command('snipeit:expected-checkin')->daily();
$schedule->command('snipeit:upcoming-audits')->daily();
$schedule->command('auth:clear-resets')->everyFifteenMinutes();

So basically, the scheduler will figure out whether or not it needs to trigger any of these tasks, so that you only need to set one cron job task instead of multiple tasks.

Alert Preferences

You can specify the level of inventory and time range that should start to trigger alerts in Admin > General Settings.

1458

Bypassing the Scheduler

To set up cron jobs separately for expiring asset/license alerts for whatever reason (maybe you want to run your tasks more or less often than the scheduler expects to run tasks), you can still invoke the tasks individually.

If you wish to be reminded via email when your assets are about to reach EOL, or when your licenses are expiring, make sure you have an alert email address listed in Admin > Settings.

To set up the cron to run every day, set up your crontab as:

@daily /path/to/php /path/to/your/snipe-it/artisan snipeit:expiring-alerts

To set it to run every week, use:

@weekly /path/to/php /path/to/your/snipe-it/artisan snipeit:expiring-alerts

Or to set your backups to daily instead of weekly:

@daily /path/to/php /path/to/your/snipe-it/artisan snipeit:backup

Running Commands Directly

While there's not normally much reason to invoke the alerts commands manually, if you need to do so (for example from another script, or for testing purposes), run them via the command line from your Snipe-IT project root like this:

📘

All commands should be run from the Snipe-IT project directory. If the PHP binary is not accessible from there, you must specify the path to PHP as well.

# Run a backup
php artisan snipeit:backup
# Cleanup old backups
php artisan backup:clean
# Send email alerts for expiring items
php artisan snipeit:expiring-alerts
# Send low inventory alert emails
php artisan snipeit:inventory-alerts
# Send email expected checkin alerts
php artisan snipeit:expected-checkin
# Send email alerts of current inventory to all users with an email address
php artisan snipeit:user-inventory
# Send email alerts of upcoming audits
php artisan snipeit:upcoming-audits
# Clear password reset table
php artisan auth:clear-resets

Related Information