Skip to content

Commit

Permalink
storing generated files at independent location
Browse files Browse the repository at this point in the history
  • Loading branch information
sukhbir-singh committed Jul 5, 2018
1 parent 1e84b3a commit 8525a91
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/smart_statuses/smart_test_util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ def stats

def get_created_file_path(device)
return nil if device.blank?
status_file = Rails.root+Dir["plugins/*smart_statuses/db/smartctl-"+device[5..-1]][0]
read_smart_status(status_file)
status_file_path = "/home/.smartctl-data/smartctl-"+device[5..-1]
read_smart_status(status_file_path)
end

def sample_stats
Expand Down
3 changes: 2 additions & 1 deletion script/fetch-smart-status
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ lsblk -o name,type | grep disk | awk '{print $1;}' >> disk_names

while read line
do
smartctl -H '/dev/'$line > '../db/smartctl-'$line
mkdir /home/.smartctl-data
smartctl -H '/dev/'$line > '/home/.smartctl-data/smartctl-'$line
done < disk_names

EOF
Expand Down

0 comments on commit 8525a91

Please sign in to comment.