19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/flydata/cron.rb', line 19
def update(option=nil)
arg = option ? option : ''
check_crontab_command
dump_cron_setting
reagistered = check_cron_setting
if arg == REMOVE_OPTION
unless reagistered
puts "Skip removing. There are no flydata jobs in crontab."
else
remove_cron_setting
puts "Updated crontab to remove the deletion of your log data."
end
else
if reagistered
puts "Skip register. Already cron setup done."
else
add_cron_setting
puts "Updated crontab to manage the deletion of your log data."
end
end
true
end
|