What's new

Change cronjob times

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

poudenes

Occasional Visitor
Hi All,

I have some scripts running. Installed via amtm.
I checked the cron jobs and this is the list:

Code:
*/15 * * * * /jffs/scripts/domain_vpn_routing.sh querypolicy all #setup_domain_vpn_routing#                                                                                                                    
 5 0 * * * /opt/sbin/logrotate /opt/etc/logrotate.conf >> /opt/tmp/logrotate.daily 2>&1 #logrotate#                                                                                                            
 18 0 */7 * * service restart_letsencrypt #LetsEncrypt#                                                                                                                                                        
 */10 * * * * /jffs/scripts/ntpmerlin generate #ntpMerlin#                                                                                                                                                      
 */2 * * * * /etc/openvpn/server1/vpn-watchdog1.sh #CheckVPNServer1#                                                                                                                                            
 */5 * * * * /jffs/scripts/dn-vnstat generate #dn-vnstat_generate#                                                                                                                                              
 59 23 * * * /jffs/scripts/dn-vnstat summary #dn-vnstat_summary#                                                                                                                                                
 25 18 * * * sh /jffs/scripts/firewall banmalware #Skynet_banmalware#                                                                                                                                          
 11 1 * * Mon sh /jffs/scripts/firewall update #Skynet_autoupdate#                                                                                                                                              
 0 * * * * sh /jffs/scripts/firewall save #Skynet_save#                                                                                                                                                        
 47 */12 * * * sh /jffs/scripts/firewall debug genstats #Skynet_genstats#                                                                                                                                      
 00 2 * * Fri /bin/sh /opt/share/diversion/file/update-bl.div reset #Diversion_UpdateBL#                                                                                                                        
 20 5 * * * /bin/sh /opt/share/diversion/file/rotate-logs.div #Diversion_RotateLogs#                                                                                                                            
 20 17 * * * diversion count_ads count #Diversion_CountAds#                                                                                                                                                    
 30 1 * * Fri /bin/sh /opt/share/diversion/file/stats.div #Diversion_WeeklyStats#

Is it safe to change those times? I prefer most of the scripts running at night and not at daytime.
Or is there a tool to use to manage cronjobs?

To something like this

Code:
# Every X minutes
*/2 * * * * /etc/openvpn/server1/vpn-watchdog1.sh #CheckVPNServer1#        
*/5 * * * * /jffs/scripts/dn-vnstat generate #dn-vnstat_generate#  
*/10 * * * * /jffs/scripts/ntpmerlin generate #ntpMerlin#  
*/15 * * * * /jffs/scripts/domain_vpn_routing.sh querypolicy all #setup_domain_vpn_routing#                                                                                                                    

# Only on 7th day of month
10 0 */7 * * service restart_letsencrypt #LetsEncrypt#   

# Every X minutes of the hour
10 1 * * * /opt/sbin/logrotate /opt/etc/logrotate.conf >> /opt/tmp/logrotate.daily 2>&1 #logrotate#                                                                                                            
15 1 * * * /jffs/scripts/dn-vnstat summary #dn-vnstat_summary#                                                                                                                                               
25 1 * * * sh /jffs/scripts/firewall banmalware #Skynet_banmalware#                                                                                                                                       
30 1 * * * sh /jffs/scripts/firewall save #Skynet_save#   
35 1 * * * /bin/sh /opt/share/diversion/file/rotate-logs.div #Diversion_RotateLogs#
40 1 * * * diversion count_ads count #Diversion_CountAds#       

# Only on Monday or friday
20 1 * * Mon sh /jffs/scripts/firewall update #Skynet_autoupdate# 
45 1 * * Fri /bin/sh /opt/share/diversion/file/stats.div #Diversion_WeeklyStats#    
50 1 * * Fri /bin/sh /opt/share/diversion/file/update-bl.div reset #Diversion_UpdateBL#  

# At 55 every 12th hour
55 */12 * * * sh /jffs/scripts/firewall debug genstats #Skynet_genstats#
 
Last edited:
Most scripts will manage their own cron jobs one way or another. It could be different for each script you have installed. Some might let you change the days, others might not let you change anything, and some may pick random hours/minutes.
 
Hi All,

I have some scripts running. Installed via amtm.
I checked the cron jobs and this is the list:

Code:
*/15 * * * * /jffs/scripts/domain_vpn_routing.sh querypolicy all #setup_domain_vpn_routing#                                                                                                                   
 5 0 * * * /opt/sbin/logrotate /opt/etc/logrotate.conf >> /opt/tmp/logrotate.daily 2>&1 #logrotate#                                                                                                           
 18 0 */7 * * service restart_letsencrypt #LetsEncrypt#                                                                                                                                                       
 */10 * * * * /jffs/scripts/ntpmerlin generate #ntpMerlin#                                                                                                                                                     
 */2 * * * * /etc/openvpn/server1/vpn-watchdog1.sh #CheckVPNServer1#                                                                                                                                           
 */5 * * * * /jffs/scripts/dn-vnstat generate #dn-vnstat_generate#                                                                                                                                             
 59 23 * * * /jffs/scripts/dn-vnstat summary #dn-vnstat_summary#                                                                                                                                               
 25 18 * * * sh /jffs/scripts/firewall banmalware #Skynet_banmalware#                                                                                                                                         
 11 1 * * Mon sh /jffs/scripts/firewall update #Skynet_autoupdate#                                                                                                                                             
 0 * * * * sh /jffs/scripts/firewall save #Skynet_save#                                                                                                                                                       
 47 */12 * * * sh /jffs/scripts/firewall debug genstats #Skynet_genstats#                                                                                                                                     
 00 2 * * Fri /bin/sh /opt/share/diversion/file/update-bl.div reset #Diversion_UpdateBL#                                                                                                                       
 20 5 * * * /bin/sh /opt/share/diversion/file/rotate-logs.div #Diversion_RotateLogs#                                                                                                                           
 20 17 * * * diversion count_ads count #Diversion_CountAds#                                                                                                                                                   
 30 1 * * Fri /bin/sh /opt/share/diversion/file/stats.div #Diversion_WeeklyStats#

Is it safe to change those times? I prefer most of the scripts running at night and not at daytime.
Or is there a tool to use to manage cronjobs?

To something like this

Code:
# Every X minutes
*/2 * * * * /etc/openvpn/server1/vpn-watchdog1.sh #CheckVPNServer1#       
*/5 * * * * /jffs/scripts/dn-vnstat generate #dn-vnstat_generate# 
*/10 * * * * /jffs/scripts/ntpmerlin generate #ntpMerlin# 
*/15 * * * * /jffs/scripts/domain_vpn_routing.sh querypolicy all #setup_domain_vpn_routing#                                                                                                                   

# Only on 7th day of month
10 0 */7 * * service restart_letsencrypt #LetsEncrypt#  

# Every X minutes of the hour
10 1 * * * /opt/sbin/logrotate /opt/etc/logrotate.conf >> /opt/tmp/logrotate.daily 2>&1 #logrotate#                                                                                                           
15 1 * * * /jffs/scripts/dn-vnstat summary #dn-vnstat_summary#                                                                                                                                              
25 1 * * * sh /jffs/scripts/firewall banmalware #Skynet_banmalware#                                                                                                                                      
30 1 * * * sh /jffs/scripts/firewall save #Skynet_save#  
35 1 * * * /bin/sh /opt/share/diversion/file/rotate-logs.div #Diversion_RotateLogs#
40 1 * * * diversion count_ads count #Diversion_CountAds#      

# Only on Monday or friday
20 1 * * Mon sh /jffs/scripts/firewall update #Skynet_autoupdate#
45 1 * * Fri /bin/sh /opt/share/diversion/file/stats.div #Diversion_WeeklyStats#   
50 1 * * Fri /bin/sh /opt/share/diversion/file/update-bl.div reset #Diversion_UpdateBL# 

# At 55 every 12th hour
55 */12 * * * sh /jffs/scripts/firewall debug genstats #Skynet_genstats#
For Diversion it‘s b,2,1 for the blocking list updates. The stats are generated half an hour before that time.

The count ads and rotate jobs are hard coded, do not change them, Diversion will revert them to default if the router or Dnsmasq restarts.
 
So your suggest to leave it alone at all. :) sometimes I have ocd and want have things in control hahaha.... I have a 1Gbps so basically I won't see any difference when there is a update running on the router.
It's the feeling I want everything at night. And if it was harmless to change it then I change it. Haha
 
So your suggest to leave it alone at all. :) sometimes I have ocd and want have things in control hahaha.... I have a 1Gbps so basically I won't see any difference when there is a update running on the router.
It's the feeling I want everything at night. And if it was harmless to change it then I change it. Haha
Some are jobs from scripts you installed, others ar for services the router provides, like letsencrypt. There are resons behind why they run at certain times. Also, there is order in that chaos, the beauty lies in that whenever the router reboots or restarts some services, the order will change. Cron just looks at the file, wakes up to run the command at the exact minute and goes back to sleep. I like that simple logic.
 
Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top