mirror of
https://github.com/laurent22/rsync-time-backup
synced 2024-11-10 14:14:16 +00:00
rsync doesn't work with files
Use rsync only to delete directories and stick to rm for files.
This commit is contained in:
parent
78d7121586
commit
dff1ea00e1
1 changed files with 7 additions and 1 deletions
|
@ -101,7 +101,13 @@ fn_mkdir() {
|
|||
|
||||
fn_rm() {
|
||||
fn_run_cmd "mkdir /tmp/rsync-time-backup-emptydir"
|
||||
fn_run_cmd "rsync -a --delete /tmp/rsync-time-backup-emptydir/ '$1'"
|
||||
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'"
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue