mirror of
https://github.com/laurent22/rsync-time-backup
synced 2024-11-10 14:14:16 +00:00
Merge pull request #71 from joekerna/fn_rm
Improve speed of expiring backups
This commit is contained in:
commit
674d5a1878
1 changed files with 9 additions and 1 deletions
|
@ -100,7 +100,15 @@ fn_mkdir() {
|
|||
}
|
||||
|
||||
fn_rm() {
|
||||
fn_run_cmd "rm -rf -- '$1'"
|
||||
fn_run_cmd "mkdir /tmp/rsync-time-backup-emptydir"
|
||||
if [ -d '$1' ] ; then
|
||||
# when deleting a directory use rsyny for performance reasons
|
||||
fn_run_cmd "rsync -a --delete /tmp/rsync-time-backup-emptydir/ '$1'"
|
||||
elif [ -f '$1' ]; then
|
||||
# when deleting a file use regular rm
|
||||
fn_run_cmd "rm -f '$1'"
|
||||
fi
|
||||
fn_run_cmd "rm -rf /tmp/rsync-time-backup-emptydir '$1'"
|
||||
}
|
||||
|
||||
fn_touch() {
|
||||
|
|
Loading…
Reference in a new issue