Skip to content

Commit

Permalink
if home isnt set, try to intuit homedir
Browse files Browse the repository at this point in the history
  • Loading branch information
acoffman committed Jun 20, 2017
1 parent 726dc52 commit 910f46f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/jobs/generate_database_backup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ def create_database_dump
end

def filename
File.join(ENV['HOME'], Date.today.strftime("backup_%m_%d_%y.sql"))
File.join(homedir, Date.today.strftime("backup_%m_%d_%y.sql"))
end

def homedir
ENV['HOME'] || File.join('/home', ENV['USER'])
end
def next_week
Date.today
.beginning_of_week
Expand Down

0 comments on commit 910f46f

Please sign in to comment.