File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 30
30
e.g. ` vim -S Session1.vim ` .
31
31
- Enable restoring command arguments for inline strategies with ` * ` character.
32
32
- Kill session "0" if it wasn't restored.
33
+ - Add ` @resurrect-delete-backup-after ` option to specify how many days of
34
+ backups to keep - default is 30.
33
35
34
36
### v2.4.0, 2015-02-23
35
37
- add "tmux-test"
Original file line number Diff line number Diff line change @@ -269,11 +269,12 @@ dump_shell_history() {
269
269
}
270
270
271
271
remove_old_backups () {
272
- # remove resurrect files older than 30 days, but keep at least 5 copies of backup.
272
+ # remove resurrect files older than 30 days (default), but keep at least 5 copies of backup.
273
+ local delete_after=" $( get_tmux_option " $delete_backup_after_option " " $default_delete_backup_after " ) "
273
274
local -a files
274
275
files=($( ls -t $( resurrect_dir) /${RESURRECT_FILE_PREFIX} _* .${RESURRECT_FILE_EXTENSION} | tail -n +6) )
275
276
[[ ${# files[@]} -eq 0 ]] ||
276
- find " ${files[@]} " -type f -mtime +30 -exec rm -v " {}" \;
277
+ find " ${files[@]} " -type f -mtime " + ${delete_after} " -exec rm -v " {}" \;
277
278
}
278
279
279
280
save_all () {
Original file line number Diff line number Diff line change @@ -46,3 +46,6 @@ overwrite_option="@resurrect-never-overwrite"
46
46
47
47
# Hooks are set via ${hook_prefix}${name}, i.e. "@resurrect-hook-post-save-all"
48
48
hook_prefix=" @resurrect-hook-"
49
+
50
+ delete_backup_after_option=" @resurrect-delete-backup-after"
51
+ default_delete_backup_after=" 30" # days
You can’t perform that action at this time.
0 commit comments