flydata 0.0.1.2011102302 → 0.0.1.2011102303

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1.2011102302
1
+ 0.0.1.2011102303
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "flydata"
8
- s.version = "0.0.1.2011102302"
8
+ s.version = "0.0.1.2011102303"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Koichi Fujikawa"]
12
- s.date = "2012-10-23"
12
+ s.date = "2012-10-24"
13
13
  s.description = "FlyData Command Line Interface"
14
14
  s.email = "sysadmin@flydata.co"
15
15
  s.executables = ["flydata"]
@@ -31,10 +31,13 @@ Gem::Specification.new do |s|
31
31
  "lib/flydata/command/base.rb",
32
32
  "lib/flydata/command/crontab.rb",
33
33
  "lib/flydata/command/login.rb",
34
+ "lib/flydata/command/restart.rb",
34
35
  "lib/flydata/command/routine.rb",
35
36
  "lib/flydata/command/sender.rb",
36
37
  "lib/flydata/command/setlogdel.rb",
37
38
  "lib/flydata/command/setup.rb",
39
+ "lib/flydata/command/start.rb",
40
+ "lib/flydata/command/stop.rb",
38
41
  "lib/flydata/credentials.rb",
39
42
  "lib/flydata/cron.rb",
40
43
  "lib/flydata/flydata_crontab.sh",
@@ -0,0 +1,10 @@
1
+ module Flydata
2
+ module Command
3
+ class Restart < Base
4
+ def run
5
+ sender = Flydata::Command::Sender.new
6
+ sender.restart
7
+ end
8
+ end
9
+ end
10
+ end
@@ -54,7 +54,7 @@ module Flydata
54
54
  process_exist?
55
55
  end
56
56
  def process_exist?
57
- process_count = `ps aux|grep -v grep|grep "\\.flydata/"|grep fluentd|wc -l`.to_i
57
+ process_count = `ps aux|grep -v grep|grep "\\.flydata/flydata\\.conf"|grep fluentd|wc -l`.to_i
58
58
  process_count > 0
59
59
  end
60
60
  end
@@ -60,6 +60,7 @@ module Flydata
60
60
  url = "/data_entries/#{data_entry['id']}"
61
61
  ret = flydata.put(url, param)
62
62
  raise 'Failed to update the log deletion setting.' unless ret['success']
63
+ Flydata::Command::Crontab.new.run if !data_entry['log_deletion']
63
64
  puts "Update succeeded!"
64
65
  end
65
66
  end
@@ -68,6 +68,7 @@ module Flydata
68
68
  def create_log_entry(path, log_deletion)
69
69
  data_port = flydata.data_port.get
70
70
  flydata.data_entry.create(data_port_id: data_port['id'], log_path: path, log_deletion: log_deletion)
71
+ Flydata::Command::Crontab.new.run if log_deletion
71
72
  say("Process successfuly!") if flydata.response.code == 200
72
73
  end
73
74
  def more_entry?
@@ -0,0 +1,10 @@
1
+ module Flydata
2
+ module Command
3
+ class Start < Base
4
+ def run
5
+ sender = Flydata::Command::Sender.new
6
+ sender.start
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ module Flydata
2
+ module Command
3
+ class Stop < Base
4
+ def run
5
+ sender = Flydata::Command::Sender.new
6
+ sender.stop
7
+ end
8
+ end
9
+ end
10
+ end
@@ -8,10 +8,12 @@ FLYDATA_HOME=~/".flydata"
8
8
  CRON_TMP_PATH="$FLYDATA_HOME/cron_list.tmp"
9
9
  CRON_BACKUP_PATH="$FLYDATA_HOME/cron_list.back"
10
10
  LOG_PATH="$FLYDATA_HOME/flydata_cron.log"
11
- ROUTINE_COMMAND="flydata routine >> $LOG_PATH 2>&1"
12
- #ROUTINE_COMMAND="bundle exec "~/"github/hapyrus/flydata/cli/bin/""flydata routine >> $LOG_PATH 2>&1"
13
- CRON_LINE='15 4 * * *'" $ROUTINE_COMMAND"
14
- #CRON_LINE='* * * * *'" $ROUTINE_COMMAND"
11
+ ROUTINE_COMMAND="$FLYDATA_HOME/bin/flydata routine >> $LOG_PATH 2>&1"
12
+ if [[ "$FLYDATA_API_HOST" != "" ]]; then
13
+ ROUTINE_COMMAND="export FLYDATA_API_HOST=$FLYDATA_API_HOST && $ROUTINE_COMMAND"
14
+ fi
15
+ #CRON_LINE='15 4 * * *'" $ROUTINE_COMMAND"
16
+ CRON_LINE='* * * * *'" $ROUTINE_COMMAND"
15
17
 
16
18
  ARG=$1
17
19
  REMOVE_OPTION="-r"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flydata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.2011102302
4
+ version: 0.0.1.2011102303
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-23 00:00:00.000000000 Z
12
+ date: 2012-10-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
@@ -243,10 +243,13 @@ files:
243
243
  - lib/flydata/command/base.rb
244
244
  - lib/flydata/command/crontab.rb
245
245
  - lib/flydata/command/login.rb
246
+ - lib/flydata/command/restart.rb
246
247
  - lib/flydata/command/routine.rb
247
248
  - lib/flydata/command/sender.rb
248
249
  - lib/flydata/command/setlogdel.rb
249
250
  - lib/flydata/command/setup.rb
251
+ - lib/flydata/command/start.rb
252
+ - lib/flydata/command/stop.rb
250
253
  - lib/flydata/credentials.rb
251
254
  - lib/flydata/cron.rb
252
255
  - lib/flydata/flydata_crontab.sh
@@ -272,7 +275,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
272
275
  version: '0'
273
276
  segments:
274
277
  - 0
275
- hash: 2729482979291273575
278
+ hash: 54477074292210707
276
279
  required_rubygems_version: !ruby/object:Gem::Requirement
277
280
  none: false
278
281
  requirements: