Skip to content

Commit

Permalink
Reduce database backup history
Browse files Browse the repository at this point in the history
  • Loading branch information
isrba committed Aug 29, 2020
1 parent 9258e67 commit a190327
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/shared/lib/tasks/backup.rake
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ namespace :backup do

FileUtils.mkdir_p(path) unless File.exists?(path)

`find #{path} -maxdepth 1 -type f -mtime +3 -name #{config[:database].gsub(/_/, '-')}-\* -delete`
`pg_dump -U #{config[:username]} #{config[:database]} > #{file}`
`cd #{path} && tar czf #{name}.tar.gz #{name} && rm #{name}`
`find #{path} -maxdepth 1 -type f -mtime +31 -name #{config[:database].gsub(/_/, '-')}-\* -delete`
end
end

0 comments on commit a190327

Please sign in to comment.