Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/lib/writers_base/installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def uninstall
end

def install
uninstall
periods.each do |period|
entries(period).each do |tool|
path = dest(period, tool)
Expand Down
2 changes: 1 addition & 1 deletion app/lib/writers_base/tool/access_log_compress_tool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def exec(args = {})
end

def description
return "#{dir}の#{days}日経過したログファイルを、gzip圧縮します。"
return "#{dir}の#{days}日経過したログファイルを、zstd圧縮します。"
end

private
Expand Down
6 changes: 3 additions & 3 deletions app/lib/writers_base/tool/mysql_dump_tool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def dump(path, params = {})
'-u', params[:user],
'--port', params[:port],
params[:db],
:|, 'gzip',
:|, 'zstd', "-#{config['/zstd/level']}",
:>, path
])
command.env = {'MYSQL_PWD' => params[:password]}
Expand All @@ -56,13 +56,13 @@ def delete_old_files(dir)
def finder(dir)
finder = Ginseng::FileFinder.new
finder.dir = dir
finder.patterns = ['*.sql.gz']
finder.patterns = ['*.sql.zst', '*.sql.gz']
finder.mtime = days
return finder
end

def dump_path(db, dir)
return File.join(dir, "#{db}_#{Time.now.strftime('%Y-%m-%d')}.sql.gz")
return File.join(dir, "#{db}_#{Time.now.strftime('%Y-%m-%d')}.sql.zst")
end

def dest_dir
Expand Down
6 changes: 3 additions & 3 deletions app/lib/writers_base/tool/postgresql_dump_tool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def dump(path, params = {})
'-U', params[:user],
'-p', params[:port],
'-d', params[:db],
:|, 'gzip',
:|, 'zstd', "-#{config['/zstd/level']}",
:>, path
])
command.env = {'PGPASSWORD' => params[:password]}
Expand All @@ -56,13 +56,13 @@ def delete_old_files(dir)
def finder(dir)
finder = Ginseng::FileFinder.new
finder.dir = dir
finder.patterns = ['*.sql.gz']
finder.patterns = ['*.sql.zst', '*.sql.gz']
finder.mtime = days
return finder
end

def dump_path(db, dir)
return File.join(dir, "#{db}_#{Time.now.strftime('%Y-%m-%d')}.sql.gz")
return File.join(dir, "#{db}_#{Time.now.strftime('%Y-%m-%d')}.sql.zst")
end

def dest_dir
Expand Down
4 changes: 1 addition & 3 deletions config/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ package:
- tkoishi@b-shock.co.jp
license: MIT
url: https://github.com/THE-POWERNEWS/writersbase-tools
version: 1.4.1
version: 1.4.2
ruby:
jit: false
bin: /usr/bin/ruby3.3
hourly: []
daily: []
Expand Down Expand Up @@ -77,7 +76,6 @@ rsync_backup:
sources:
- /etc
- /usr/local/etc
- /home/mastodon/repos/mastodon
excludes:
- .git
- .zfs
Expand Down