Timeline for nohup inside a script, started with at
Current License: CC BY-SA 4.0
8 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 8, 2023 at 13:37 | vote | accept | vrms | ||
| Jun 8, 2023 at 11:44 | answer | added | symcbean | timeline score: 2 | |
| Jun 8, 2023 at 11:12 | comment | added | Marcus Müller | I think the replication approach is the most correct one, isn't it? Replicate, freeze, dump. But replicating usually needs an initial backup of the main databases, so you're back to needing to dump that? | |
| Jun 8, 2023 at 11:11 | comment | added | Marcus Müller | b)I'd advise a bit against piping through xz which isn't really known for its speed, so it might introduce a new bottleneck.gzip is faster, but still single-threaded (use Adler's pigz instead whenever possible), but the compression/speed ratio is still pretty bad by modern compressors' standards. zstd -3 typically outperforms gzip/zlib in any aspect and way: faster than gzip -1 (and any higher gzip compression setting), and better at compressing than gzip -9 (and any faster gzip seeing). If you need even faster compression than zstd, lz4 is also an option for some requirements. | |
| Jun 8, 2023 at 10:44 | comment | added | cas | BTW, this could be sped up by a) writing the .out file to a different disk (not just a different partition, but a different drive, perhaps even to another system via ssh) and b) piping the output of pg_dump through gzip or xz or some other compresser before redirecting to the output file (trading I/O for CPU). Another way to speed up pg backups it to replicate the database(s) on it to a secondary server, and run your backups on the secondary - the primary server will have an on-going small hit to I/O performance but won't be affected at all during the backup. | |
| Jun 8, 2023 at 10:39 | comment | added | cas | nice isn't likely to be of much use, either, as pg_dump will be mostly I/O bound. The real concern is all those unquoted variables in the script. See $VAR vs ${VAR} and to quote or not to quote and Why does my shell script choke on whitespace or other special characters?. Also Security implications of forgetting to quote a variable in bash/POSIX shells | |
| Jun 8, 2023 at 10:08 | comment | added | Marcus Müller | why would you want to use nohup with at? There's no interactive terminal associated with things run from at anyways. Wo, which problem are we actually solving here? | |
| Jun 8, 2023 at 10:01 | history | asked | vrms | CC BY-SA 4.0 |