Cron
Add Cron Job to backup the server log for custom websites
Some time we want to configure the log for every website in a specifc folder here is how to add a cronjon for the last 10 days
37 3 * * * /usr/sbin/logrotate -f -s /var/www/share/etc/logrotate/{website_name}.status /var/www/share/etc/logrotate/{website_name}.conf
where {website_name} any name you want
now what is the content of the {website_name}.conf
here is an example
Magento: Reindex everyday on specific time
You can add this to your code in order to reindex in UTC -5
0 5 * * * cd /home/{your-full-path}/public_html/ && php -f bin/magento indexer:reindex
How to Display the List of All Jobs in Cron / Crontab
How to view the Crontab list of jobs
To view Root’s Cron Jobs
crontab -l
View a User’s Cron Jobs
crontab -u username -l
Example with user testuser:
crontab -u testuser -l
View Daily Cron Jobs
First view all the daily cron jobs: