set the --rsyncable option for gzip
This commit is contained in:
parent
7a58eb2e16
commit
e8419fb5bb
|
@ -17,7 +17,7 @@ module Backup
|
||||||
FileUtils.mkdir_p(File.dirname(db_file_name))
|
FileUtils.mkdir_p(File.dirname(db_file_name))
|
||||||
FileUtils.rm_f(db_file_name)
|
FileUtils.rm_f(db_file_name)
|
||||||
compress_rd, compress_wr = IO.pipe
|
compress_rd, compress_wr = IO.pipe
|
||||||
compress_pid = spawn(*%w(gzip -1 -c), in: compress_rd, out: [db_file_name, 'w', 0600])
|
compress_pid = spawn(*%w(gzip --rsyncable -1 -c), in: compress_rd, out: [db_file_name, 'w', 0600])
|
||||||
compress_rd.close
|
compress_rd.close
|
||||||
|
|
||||||
dump_pid =
|
dump_pid =
|
||||||
|
|
|
@ -31,10 +31,10 @@ module Backup
|
||||||
raise Backup::Error, 'Backup failed'
|
raise Backup::Error, 'Backup failed'
|
||||||
end
|
end
|
||||||
|
|
||||||
run_pipeline!([%W(#{tar} --exclude=lost+found -C #{@backup_files_dir} -cf - .), %w(gzip -c -1)], out: [backup_tarball, 'w', 0600])
|
run_pipeline!([%W(#{tar} --exclude=lost+found -C #{@backup_files_dir} -cf - .), %w(gzip --rsyncable -c -1)], out: [backup_tarball, 'w', 0600])
|
||||||
FileUtils.rm_rf(@backup_files_dir)
|
FileUtils.rm_rf(@backup_files_dir)
|
||||||
else
|
else
|
||||||
run_pipeline!([%W(#{tar} --exclude=lost+found -C #{app_files_dir} -cf - .), %w(gzip -c -1)], out: [backup_tarball, 'w', 0600])
|
run_pipeline!([%W(#{tar} --exclude=lost+found -C #{app_files_dir} -cf - .), %w(gzip --rsyncable -c -1)], out: [backup_tarball, 'w', 0600])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue