summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
...
* | Merge branch 't/exec_cleanups'Andre Noll2012-07-20
|\ \ | |/ |/| | | | | | | 06a23c Simplify exec functions. Was cooking quite long and no problems showed up.
| * Simplify exec functions.Andre Noll2011-06-18
| | | | | | | | | | These were copied from elsewhere long ago and are more general than what is needed for dss.
* | doc: Add a second example config file.Andre Noll2012-04-30
|/ | | | | | | This commit provides another example for the INSTALL file. It illustrates the use of some more sophisticated config options of dss. Many thanks to Ivo Welch who suggested this change.
* NEWS update.Andre Noll2011-03-31
|
* NEWS updateAndre Noll2011-02-07
|
* Merge branch 't/recycling'Andre Noll2011-02-07
|\
| * Introduce snapshot recycling.Andre Noll2010-11-06
| | | | | | | | | | | | | | | | | | When snapshotting large file systems whose contents do not change much between snapshots, we end up removing large amounts of files just to recreate (hard links to) most of them afterwards. This patch changes snapshot creation so that outdated, redundant and orphaned snapshots are reused as the basis for new snapshots. Only if no existing snapshot is suitable for recycling, a new one is created.
* | Merge branch 't/logfile_only_for_daemon'Andre Noll2011-02-07
|\ \
| * | Use logfile only for --run --daemon.Andre Noll2010-06-17
| | | | | | | | | | | | | | | | | | In all other cases it does not really make sense, so it is better to write log output to stderr in these cases, even if --logfile was given.
* | | Minor documentation improvements.Andre Noll2010-11-14
| | |
* | | Include the NEWS file in the web page.Andre Noll2010-11-13
| | | | | | | | | | | | | | | Reformat the release headers in the NEWS file to make the html variant produced by grutatxt nicer.
* | | INSTALL: Fix typo in example.Andre Noll2010-11-10
| | | | | | | | | | | | | | | The dss command line option is called --ls rather than --list. Thanks to Henry Vogt who spotted this documentation bug.
* | | Mention that inode monitoring works also for ext2 and ext4.Andre Noll2010-11-09
| | |
* | | Change default program for all hooks from /bin/true to true.Andre Noll2010-11-09
| | | | | | | | | | | | | | | | | | | | | | | | At least on Mac OS, true is /usr/bin/true, not /bin/true. So the old default /bin/true causes all hooks to fail on these systems. Since we execute external programs via execvp() anyway, there is no need to hardcode the path. Thanks to Henry Vogt for pointing out this flaw.
* | | dss-0.1.4.v0.1.4Andre Noll2010-11-08
| | |
* | | Add NEWS file.Andre Noll2010-11-08
| | | | | | | | | | | | | | | | | | It contains the release date and the some notes about what has changed. The text is identical to what is listed as "Changes" on the freshmeat pages.
* | | Change copyright year from 2009 to 2010.Andre Noll2010-11-06
| |/ |/| | | | | Better late than never..
* | Dump config and internal state on SIGHUP.Andre Noll2010-06-15
|/ | | | | | | | | | | | | | This patch changes the signal handling of SIGHUP so information about the internal state and the config are written to the log file. Both the old and the reloaded configuration are written to make it easier to investigate what has changed. Internal state output consist of the value of all global variables, inclusing hook state, PIDs, free disk space and path information. The patch also adds a one-line description of each possible hook state, and this description is also printed on SIGHUP.
* Merge branch 't/unconditional_hooks'Andre Noll2010-05-12
|\
| * Don't check whether hooks are given.Andre Noll2010-04-16
| | | | | | | | Just use the default /bin/true if no hook was given.
| * Make all hooks default to /bin/true.Andre Noll2010-04-16
| | | | | | | | | | This way, we can always execute the hook which should simplify the code a bit.
* | Unify sending of signals.Andre Noll2010-05-12
| | | | | | | | | | | | This patch introduces dss_kill(), a wrapper for kill(2) which prints a nice log message and checks the return value of the the underlying call to kill().
* | Skip unnecessary check whether next snapshot is due.Andre Noll2010-05-12
|/ | | | | If the status of the create hook is PRE_SUCCESS, we _know_ that the next snapshot is due.
* Remove a noisy debug log message.Andre Noll2010-04-16
| | | | This message was not very useful at all and spammed the log quite a bit.
* Invalidate create_pid if create process has died.Andre Noll2010-04-16
| | | | | | We're checking create_pid against zero at several places, for example before sending a signal to the create process. So set create_pid is zero in handle_sigchld() if the create process just died.
* Log a message when sending signals to the create process.Andre Noll2010-04-05
|
* pre_remove_hook: Really pass full path of the snapshot.Andre Noll2010-04-05
| | | | | We computed and logged the correct command, but executed the wrong one.
* Reuse old rsync argv if rsync has to be restarted.Andre Noll2010-03-25
| | | | | | | | | | | If rsync must be restarted due to an exit code of 12 or 13, create_rsync_argv() was called even if the old rsync_argv should be reused in this case. This (correctly) triggers the assertion assert(!name_of_reference_snapshot); in create_rsync_argv(). Fix this by not calling create_rsync_argv() if there is a reference snapshot.
* Don't invalidate current_snapshot_time during compute_next_snapshot_time().Andre Noll2010-03-25
| | | | This bug could lead to snapshots with creation time Jan 1 1970.
* Avoid busy loop on rsync exit status 12 or 13.Andre Noll2010-03-12
| | | | | | | | | | | | | Although we set the next snapshot time to now + 60 seconds in case rsync exits with exit status 12 or 13, we miss to check this time barrier in case the snapshot creation status is HS_NEEDS_RESTART. Fix this by adding an additional check in the switch() statement of the select loop. As this change would trigger the assertion snapshot_creation_status == HS_READY in next_snapshot_is_due(), remove this assertion.
* Fix create mode in case no post-create hook is given.Andre Noll2010-03-12
| | | | | Without the patch, dss would hang forever waiting for the post-create hook to die.
* Introduce --no-resume.Andre Noll2010-02-01
| | | | | | | | | | | | | | | | | If the dss daemon (or the rsync process) is killed while a snaphot is being created, e.g. because of a server shutdown, the latest snapshot remains incomplete until it is removed by the usual shapshot pruning mechanism. This patch changes the snapshot creation behaviour if the most recently created snapshot happens to be incomplete and the new --no-resume option is not given. In this case the directory of the incomplete snapshot is reused as the destination directory for the the new snapshot. This change saves disk space and reduces the snapshot creation time, depending of course on how far the previous rsync process got before it was interrupted.
* Fix two typos in comments.Andre Noll2009-09-03
|
* Properly invalidate create_pid also for the post-create hook.Andre Noll2009-08-28
| | | | | | | | | | | | | | | | | | | | If the process associated with the create_pid dies, handle_sigchld() investigates snapshot_creation_status to tell whether the pre-create hook, the rsync process or the post-create hook has died. In the first two cases, handle_pre_create_hook_exit() and handle_rsync_exit() are called, respectively. Both functions correctly invalidate create_pid (by resetting it to zero). However, the post-create hook handling code misses to reset create_pid. This causes dss to send SIGTERM to this pid on exit, which might be fatal as the pid might have been reassigned to some unrelated process in the meanwhile. Fix this bug by moving the invalidation of create_pid to the end of the "if (pid == create_pid)" clause, which even saves a line of code. Many thanks to Sebastian Stark who pointed out that bug.
* Dump the dss configuration on startup and on SIGHUP.Andre Noll2009-08-28
| | | | | | | | This makes it possible to look at the current dss configuration (which may differ from what is contained in the config file). This feature is handy for the users of dss and it helps to debug the dss code.
* Improve error diagnostics.Andre Noll2009-08-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When parsing the command line options we must not error out if a required option was not given because that option might be specified in the config file. Therefore we have to call cmdline_parser_ext() with params->check_required = 0. However, if --config-file is not given and the default config file (~/.dssrc) does not exist, we end up with no check for required options at all. In particular, if the required --dest-dir option is not given, conf.dest_dir is NULL and we call chdir(NULL) which returns EBADADRESS at least on Linux. This causes dss to print the error message Aug 28 11:35:07 main: Bad address which is not really helpful. Fix this shortcoming by calling cmdline_parser_ext() _again_ if no config file was read by parse_config_file(). This second call uses params->check_required = 1, so that a proper error message is printed if any required options are missing. In the above example, the output changes to ./dss: '--source-dir' option required ./dss: '--dest-dir' option required which is much better.
* Improve next_snapshot_is_due().Andre Noll2009-08-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently it's a bit weird how next_snapshot_is_due() decides whether the next snapshot time has to be (re-)computed: On startup, next_snapshot_time is zero as it is declared static. next_snapshot_is_due() checks whether next_snapshot_time is greater than the current time. If yes, then next_snapshot_time needs not be updated and the function returns false. Otherwise (e.g. if it is called for the first time), next_snapshot_time is recomputed, next_snapshot_is_due() checks again if it is greater than the current time and returns false if it is, true otherwise. Consequently, dss computes the next snapshot time twice per snapshot. Moreover, it compares next_snapshot_time twice against the current time where one comparison would suffice. The code is thus less efficient and harder to understand than necessary. This patch addresses both issues. It introduces the two trivial helper functions next_snapshot_time_is_valid() and invalidate_next_snapshot_time(). The former function simply tests next_snapshot_time against zero. It is called from next_snapshot_is_due(). If it returns false, the new compute_next_snapshot_time() is called (which makes next_snapshot_time valid). Next, the usual comparison against the current time is performed. invalidate_next_snapshot_time() sets next_snapshot_time to zero. It is called from pre_create_hook() and from handle_sighup(), the latter call is necessary because changes in the config file might lead to different snapshot creation times.
* Simplify computation of next snapshot time.Andre Noll2009-08-28
| | | | | | Using an int64_t rather than a struct timeval for the next snapshot time makes the code simpler and more readable as we don't have to use the tv_xxx() functions to perform manipulations.
* Fix off-by-one bug in find_outdated_snapshot().Andre Noll2009-08-27
| | | | | | | | | | | | | | The man page sayeth: "dss removes any snapshots older than n times u", where n is the number of unit intervals and u is the duration of a unit interval. As intervals count from zero, this means that a snapshot should be considered outdated if its interval number is greater _or equal_ than n. However, the current code only removes snapshots in intervals strictly greater than n. Fix this bug and clarify the documentation.
* Make snapshot creation trump snapshot removal.Andre Noll2009-08-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes the behaviour of dss in case the following three conditions are all met: (1) There is at least one snapshot which could be deleted (orphaned, redundant, outdated). (2) Disk space is not low. (3) A new snapshot is due. A common case where these conditions are fulfilled is when dss is started after it was not running for some time, for example due to a server crash on Friday evening... In this situation the old code created a new snapshot only after all orphaned/redundant/outdated have been removed, which can take hours and is not what one usually wants to happen in the above mentioned scenario. Instead, it is desirable to create a new snapshot ASAP, and only after this snapshot has been created, the removal of old snapshots should take place. This patch implements this behaviour and goes even one step further: If disk space is not low and a new snapshot is due or being created, dss won't trigger snapshot removal any more. Another positive side effect of this change is that snapshot creation times become more stable since the rsync process will only be interrupted by a rm process if disk space is low.
* Move check for low disk space to try_to_free_disk_space().Andre Noll2009-08-24
| | | | The value is only used there, so move the check to this function.
* dss-0.1.3.v0.1.3Andre Noll2009-07-06
|
* Change copyright year from 2008 to 2009.Andre Noll2009-07-03
| | | | A bit late, but better late than never.
* Try harder to avoid removing the reference snapshot.Andre Noll2009-06-29
| | | | | | | | | | With the old code, it was possible that dss decided to remove the snapshot which is currently being used as the hardlink directory for the current rsync process. This patch changes the behaviour so that reference snapshots are never removed. The downside of this approach is of course that it is now easier to fill up the disk..
* Don't remove the last snapshot unless disk space is low.Andre Noll2009-06-08
|
* Don't busy-loop if pre-create hook returns non-zero.Andre Noll2009-06-08
| | | | Sleep at least one minute before retrying.
* Fix removal of orphaned snapshots.Andre Noll2009-06-07
| | | | | These were detected but not removed due to the goto jumping to the wrong label.
* Improve documentation of the remove hooks.Andre Noll2009-06-07
|
* Clean up snapshot removal logic.Andre Noll2009-06-04
| | | | | | | Replace the remove_xxx_snapshot() functions by find_xxx_snapshot() and start the actual removal in the caller. This simplifies the code a bit and makes it much more readable. It also simplifies the --dry-run handling for com_prune().
* Remove orphaned snapshots first if disk space is low.Andre Noll2009-05-29
| | | | | | If the dss process gets killed, an orphaned snapshot might result. Detect this case and prefer to remove such orphaned snapshots before resorting to remove the oldest snapshot.