summaryrefslogtreecommitdiff
path: root/receiver.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1999-11-08 13:03:05 +0000
committerAndrew Tridgell <tridge@samba.org>1999-11-08 13:03:05 +0000
commit57df171bc00cd813b5d661960b567a041107af13 (patch)
tree9103106a12a13318c8ff2e6f1dcff3730c0413ff /receiver.c
parentf08baea3ddb54a99a918a3e0c557b32ca2517c6c (diff)
downloadrsync-57df171bc00cd813b5d661960b567a041107af13.tar.gz
added --delete-after option (suggested by Jason)
Diffstat (limited to 'receiver.c')
-rw-r--r--receiver.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/receiver.c b/receiver.c
index 96215789..890fadd1 100644
--- a/receiver.c
+++ b/receiver.c
@@ -304,14 +304,17 @@ int recv_files(int f_in,struct file_list *flist,char *local_name,int f_gen)
int recv_ok;
extern struct stats stats;
extern int preserve_perms;
+ extern int delete_after;
struct stats initial_stats;
if (verbose > 2) {
rprintf(FINFO,"recv_files(%d) starting\n",flist->count);
}
- if (recurse && delete_mode && !local_name && flist->count>0) {
- delete_files(flist);
+ if (!delete_after) {
+ if (recurse && delete_mode && !local_name && flist->count>0) {
+ delete_files(flist);
+ }
}
while (1) {
@@ -478,6 +481,12 @@ int recv_files(int f_in,struct file_list *flist,char *local_name,int f_gen)
}
}
+ if (delete_after) {
+ if (recurse && delete_mode && !local_name && flist->count>0) {
+ delete_files(flist);
+ }
+ }
+
if (preserve_hard_links)
do_hard_links(flist);