Fix crontab replace bug.
This commit is contained in:
parent
b50bc8e490
commit
752be34741
|
@ -21,6 +21,10 @@ elsif crontab_sync_jobs[0].include?("-23/12") #replace 12 hours to 24 hours
|
|||
crontab_jobs = `crontab -l`
|
||||
crontab_jobs = crontab_jobs.sub(crontab_sync_jobs[0],crontab_sync_jobs[0].sub("-23/12",""))
|
||||
%x(CRON="#{crontab_jobs}" && (echo "$CRON" ) | crontab -)
|
||||
elsif crontab_sync_jobs[0].include?("*/12") #replace 12 hours to 24 hours
|
||||
crontab_jobs = `crontab -l`
|
||||
crontab_jobs = crontab_jobs.sub(crontab_sync_jobs[0],crontab_sync_jobs[0].sub("*/12","0"))
|
||||
%x(CRON="#{crontab_jobs}" && (echo "$CRON" ) | crontab -)
|
||||
end
|
||||
# Describe your gem and declare its dependencies:
|
||||
Gem::Specification.new do |spec|
|
||||
|
|
Loading…
Reference in New Issue