* var/*: moved to lib for 6939144 * VERSION: bumped to 0.2.99 --HG-- rename : var/svc/manifest/application/time-slider-plugin.xml => lib/svc/manifest/application/time-slider-plugin.xml rename : var/svc/manifest/application/time-slider.xml => lib/svc/manifest/application/time-slider.xml rename : var/svc/manifest/system/filesystem/auto-snapshot.xml => lib/svc/manifest/system/filesystem/auto-snapshot.xml
* usr/share/time-slider/lib/time_slider/zfs.py: fix for d.o.o 18302, 7046724. Fix by Julian Wiesener
* VERSION: Bump to 0.2.98 * usr/share/time-slider/lib/time_slider/applet.py usr/share/time-slider/lib/time_slider/deletegui.py usr/share/time-slider/lib/time_slider/setupgui.py usr/share/time-slider/lib/time_slider/snapnowui.py usr/share/time-slider/lib/time_slider/timesliderd.py : Fix for 7038498 removed Primary Administrator references * usr/share/time-slider/lib/time_slider/util.py usr/share/time-slider/lib/time_slider/zfs.py : Fix for 6996354 gracefully handle snapshot failure
* usr/share/time-slider/lib/time_slider/setupgui.py: Don't set filesystem tree view size request based on number of filesystems: Doesn't scale well. Set fixed initial size instead. Fixes defect #16319 Correct misspellings of "writable and "administrator". Fixes defect #16388 * usr/share/time-slider/lib/time_slider/zfs.py: Check returned value of bisect.bisect_left() is within index range of list before trying to dereference it and causing IndexError exceptions. Fixes defect #16377. Thanks to Tim Foster for this fix.
* usr/share/time-slider/glade/time-slider-setup.glade: Replace GtkFileChooser combo widget with standard GtkComboBox * usr/share/time-slider/lib/time_slider/applet.py: User path_tol_volume() from util library instead of private copy * usr/share/time-slider/lib/time_slider/setupgui.py: Replace standard GtkFileChooser logic with custom combo box implementation that is more tailored towards selecting a backup device rather than a generic path. Is able to handle an offline/unmounted previously configured backup device gracefully (impossible with stock widget). Doesn't show meaningless shortcuts like Home, Documents, etc. either Cleanup of code, renamed variables to use camel case and made unnecessarily public class variables private. Changed order of target validation tests to check if the device supports posix style links before checking if it's empty. Means user doesn't have to delete everything on a PCFS/FAT32 device only then to find out it's still unsuitable. * usr/share/time-slider/lib/time_slider/util.py: Move previously private function path_to_volume(path) here so it can be shared.
* usr/share/time-slider/glade/time-slider-delete.glade: Added Type combobox * usr/share/time-slider/lib/plugin/pluginsmf.py: fix import to call this class from a non standard location * usr/share/time-slider/lib/time_slider/deletegui.py: implemented rsync backup visualization and deletion * usr/share/time-slider/lib/time_slider/zfs.py: renamed member function destroy_snapshot to destroy to reflect allow polymorphic call in deletegui.py as the list of backup to delete can now be snapshots or rsync backups. * usr/share/time-slider/lib/time_slider/timesliderd.py: propagated member function destroy name change.
* usr/share/time-slider/lib/plugin/rsync/backup.py: Fix list ValueError in list_pending_snapshots() caused when rsync plugin is enabled but no fileystems are selected for backup. Check that zfs returns something more than a blank in such cases.
* etc/dbus-1/system.d/time-slider.conf: Add service and policy definitions for TimSlider.config service. * usr/share/time-slider/lib/plugin/rsync/backup.py: Deal with backup device being mounted under variable removable media mount points if not found in it's expected location. Find and validate alternate mount points. * usr/share/time-slider/lib/time_slider/applet.py: Refactored to allow more modular notification management. Improved rsync device monitoring by implementing both gio.File and gio.Volume monitors so we can track mounting/unmounting of static mounts like nfs/zfs and variable mount points for hotpluggable devices. Validate rsync target is correct using SMF configuration key. Listen to TimeSlider.Config D-Bus events and refresh configuration when D-Bus notification is received. Add menu item to enable launching of setup GUI from the applet. * usr/share/time-slider/lib/time_slider/dbussvc.py: Add class and method definition for TimeSlider Config service notifications. * usr/share/time-slider/lib/time_slider/setupgui.py: Register with system D-Bus and send notification of changes to time-slider and rsync plugin services so the applet can refresh.
* usr/share/time-slider/lib/plugin/rsync/backup.py: Tweak the space management of the rsync device for better performance: - don't scan for deleteables unless the device starts to exceed threshhold capacity. - Rescan capacity periodically during rsync backup thread lifecycle and rescan for deleteable backups only if device exceeds threshold capacity level.
* var/svc/manifest/system/filesystem/auto-snapshot.xml: Update service bundle name and version number to SUNWtime-slider and 0.2.96 respectively. * var/svc/manifest/application/time-slider-plugin.xml: Add 2 new properties to define cleanup threshhold level of rsync backup device and verbosity of rsync output for debugging purposes. * usr/share/time-slider/lib/time_slider/util.py: Adjust signature of util.debug() to make the verbose argument mandatory instead of automatic. * usr/share/time-slider/lib/plugin/rsync/rsyncsmf.py: Add 2 new methods to retrieve cleanup threshhold and rsync verbosity properties from the rsync SMF service instance. * usr/share/time-slider/lib/plugin/rsync/backup.py: Cleanup variable naming, making class private variables actually private using leading "_" character. Rename RsyncBackup class to RsyncProcess to me more descriptive. Add support for rsync verbosity in RsyncProcess class. Implement better cleanup and space management mechanism: - Removes old backups in parallel to new rsync backups running in a separate thread if space falls below threshhold level. - Identifies what backups can and can't be deleted for a given new rsync backup based on age and number of backups left for the associated filesystem. - Cleanup threshhold tuneable via SMF atic. * usr/share/time-slider/lib/plugin/rsync/rsyncsmf.py: Add 2 new methods to retrieve cleanup threshhold and rsync verbosity properties from the rsync SMF service instance. * usr/share/time-slider/lib/plugin/rsync/backup.py: Add check to make sure config key on target device matches that stored in SMF before commencing backups. Cleanup variable naming, making class private variables actually private using leading "_" character. Rename RsyncBackup class to RsyncProcess to me more descriptive. Add support for rsync verbosity in RsyncProcess class. Implement better cleanup and space management mechanism: - Removes old backups in parallel to new rsync backups running in a separate thread if space falls below threshhold level. Avoids having to make rough, inaccurate guesses about size required for new backups because it responds in real time. - Identifies what backups can and can't be deleted for a given new rsync backup based on age and number of backups left for the associated filesystem. - Cleanup threshhold tuneable via SMF. - Doesn't try to backup snapshots older than what's already on the backup device if device is almost full.
* usr/share/time-slider/lib/plugin/rsync/backup.py: Redesigned queue management and backlog mechanism. Backs up most recent snapshot set first, then works backwards through the queue. Stops backup mechanism falling too far behind while still allowing backup of older snapshots to take place if time and space permit. Enhancements to filesystem layout of backups - added seperate folders for partial transfers, log files, trash folder and lock files. Added file locking mechanism to prevent deletion by other tools of backups in use (eg during incremental backups). Added trash mechanism, replaces in place deletion of snapshots which messes up directory mtimes and incremental backups. Instead, expired backups are moved to a .trash folder and a new method: empty_trash_folders() cleans it up after before starting the next snapshot set backup. Fix bug in list_pending_snapshots() where ctime of snapshots was returned as a string instead of a long. * usr/share/time-slider/lib/plugin/rsync/rsyncsmf.py: Add new filesystem suffix definitions for partial backups, trash folders, backup lock files and backup log files.
* usr/share/time-slider/lib/time_slider/timesliderd.py: Determine if <zpool/remedial-cleanup> SMF property is set to true. Do not perform remedial cleanups if it's value is false. * usr/share/time-slider/lib/time_slider/timeslidersmf.py: Add new method: get_remedial_cleanup() to indicate the value of property <zpool/remedial-cleanup> * var/svc/manifest/application/time-slider.xml: Add new SMF property: <zpool/remedial-cleanup> as boolean with default value of 'true'. Indicates that time-sliderd should perform remedial cleanups when snapshotted pool runs low on space.
* usr/share/time-slider/lib/plugin/plugin.py: Fix some incorrect invocations that didn't pass verbose parameter (and were therefore no-ops) * usr/share/time-slider/lib/time_slider/timesliderd.py: Fix monthly period calculation. Now handles period increments > 12 months and period increments that land on december (originally logged as bugster CR #6904417)
* usr/share/time-slider/lib/time_slider/setupgui.py: Cache all GUI configuration values at startup and use them later to compare changes in configuration state. Only apply the minimum set of configuration changes necessary instead of previous method of blindly applying everything, even if unchanged. Configuration is much much faster now, especially for minor configuration changes. Recognise previously configured backup devices and ask the user if they want to start using it again instead of rejecting it as belonging to another system. Remove duplicate import of os.path modules.
* usr/share/time-slider/lib/plugin/rsync/backup.py: Add removal of partial backups missing a matching snapshot in the backup queue. They are zombies. When catching an rsync exception, change directory to "/" so that pfexec doesn't freak out when trying to release the snapshot. pfexec bails out when it tries to add cwd to it's path if cwd is non-existent which can be the case if the backup device suddenly goes offline.
* usr/share/time-slider/lib/plugin/rsync/backup.py: Send rsync loggint to individual log files on the backup device. Delete log files when corresponding backup gets deleted. Create rsync backups in a temporary directory first and move to permanent location when completed. Prevents incomplete backups appearing in backup view in Nautilus. Also use "--inplace" rsync option to allow resumption of partial (interrupted) backups. * usr/share/time-slider/lib/plugin/rsync/rsyncsmf.py: Add shared key get/set methods for rsync SMF instance. Use new "set_string_prop" Smf class method for setting rsync target directory so that path names containing spaces can be correctly set. Conversely, strip out '\ ' space formatting characters returned by SMF in get_target_dir() method. * usr/share/time-slider/lib/plugin/rsync/trigger.py: Don't tag new snapshots whose filesystems are not mounted Prevents piling up of snapshots from unmounted BEs. Might be best to make this behaviour configurable via SMF. * usr/share/time-slider/lib/time_slider/setupgui.py: Clean up OK button clicked callback by farming out several validation checks to separate methods. Add rsync config checking method to chek configuration/selection of rsync target device. Implement shared key checking to validate/ identify pre-configured backup devices. Rejects devices configured for use on other systems. Add checks to ensure target device is writable by root and supports hard links as required for rsync incremental backups. Add a random key generation function. Perform basic space checking on rsync target device to see if it's big enough. * usr/share/time-slider/lib/time_slider/smf.py: Implement set_string_prop() method that allows white space string characters. * var/svc/manifest/application/time-slider-plugin.xml: Remove rsync plugin's property override of <plugin/trigger_on> and inherit defaults instead. Backing up frequent snapshots caused near constant backup disk churn.
* usr/share/time-slider/lib/time_slider/zfs.py: Fix bug in method "create_auto_snapshot_set() where it would skip the entire pool if the root of the pool was tagged and all datastets under the root inherited from it. Also, use sorted lists and binary searching to speed up the operation and avoid making repeated unnecessary calls to Dataset.list_children() (the data is already provided)
* usr/share/time-slider/lib/plugin/rsync/backup.py: Clean up dangling holds on snapshots left by abnormally terminated rsync transfers from previous invocations. Also, release snapshot holds if an Rsync exception is caught during transfer. Allows time-sliderd to delete snapshots when they naturally expire.