From owner-freebsd-questions Tue Dec 18 0:40:29 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mail2.resfeber.se (Resfeber-gw.customer.internet5.net [195.66.48.230]) by hub.freebsd.org (Postfix) with ESMTP id 06C4637B41A for ; Tue, 18 Dec 2001 00:40:24 -0800 (PST) Received: from resfeber.se ([212.75.72.9]) by mail2.resfeber.se (8.9.3/8.9.3) with ESMTP id JAA00763; Tue, 18 Dec 2001 09:40:11 +0100 Message-ID: <3C1F004F.9F6A7A3A@resfeber.se> Date: Tue, 18 Dec 2001 09:37:35 +0100 From: Jon Molin X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.12 i386) X-Accept-Language: en MIME-Version: 1.0 To: Dave VanAuken Cc: freebsd-questions@FreeBSD.ORG Subject: Re: retrieve and delete remote file via ssh References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG ssh user@host "rm $file" should do it. /Jon Dave VanAuken wrote: > > Am looking to do the following, can't put my finger on it. > > Goal: > scp or rsync file(s) from remote server, then remove them from remote server > > Scenario: > Server is generating task lists or information items in flat text file for a > number of slave servers. Slave servers (cron) retrieve the content of their > file and delete or truncate the file. The main server rebuilds the file with > new items while the server is processing its current list prior to retrieving > the next batch. > > Problem: > Getting files over is not an issue, but deleting or 0-lengthing the file after > it has been retrieved to avoid duplicate entries is... not sure how to go about > this and have been staring at the problem for too long for it to click. > > Appreciate any pointers. Am using SSH with keys. > > Dave > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message