Cast some F_OWNER()/F_GROUP() values to make sure that we don't get
[rsync/rsync.git] / packaging / nightly-rsync
index 58936a6..7b21f3d 100755 (executable)
@@ -96,12 +96,23 @@ foreach my $fn (qw( rsync.yo rsyncd.conf.yo )) {
     unlink($fn);
 }
 
-system "find . -name 'rsync-HEAD-*' -daystart -mtime +14 | xargs rm -f";
+my $cnt = 0;
+open(PIPE, '-|', 'ls -1t rsync-HEAD-*') or die $!;
+while (<PIPE>) {
+    chomp;
+    next if $cnt++ < 10;
+    unlink($_);
+}
+close PIPE;
+
 system 'ls -ltr';
 
 if ($upload) {
-    $ENV{RSYNC_PARTIAL_DIR} = ''; # The rsync on samba.org is OLD.
-    system "rsync -aviHP --delete-after . samba.org:/home/ftp/pub/rsync/nightly";
+    my $opt = '';
+    if (defined $ENV{RSYNC_PARTIAL_DIR}) {
+       $opt = " -f 'R $ENV{RSYNC_PARTIAL_DIR}'";
+    }
+    system "rsync$opt -aviHP --delete-after . samba.org:/home/ftp/pub/rsync/nightly";
 }
 
 exit;