From nobody Wed Apr 27 19:35:45 2022 X-Original-To: freebsd-ports@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 76B22199D096 for ; Wed, 27 Apr 2022 19:35:57 +0000 (UTC) (envelope-from sysadmin.lists@mailfence.com) Received: from wilbur.contactoffice.com (wilbur.contactoffice.com [212.3.242.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4KpTWJ4FKQz3LXF for ; Wed, 27 Apr 2022 19:35:56 +0000 (UTC) (envelope-from sysadmin.lists@mailfence.com) Received: from ichabod.co-bxl (ichabod.co-bxl [10.2.0.36]) by wilbur.contactoffice.com (Postfix) with ESMTP id 487FE2B62; Wed, 27 Apr 2022 21:35:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1651088147; s=20210208-e7xh; d=mailfence.com; i=sysadmin.lists@mailfence.com; h=Date:From:Message-ID:In-Reply-To:References:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc; l=1220; bh=p/dfdjtdW9S2KjCDng3t6lv5lqBXY24dPIx7o5NPXLE=; b=roJAwzfhsZJv8IL5MeCwJi/bnyzYPaChLp6EwNnwomwjal2jfklPKeISTPJz6oem OBXaQoAWHVbKXN1xKLWvWKS6suq/SmN51zvozua+EMTPjkJBHQiXbfClkUwsCFUNW9S ZV5i37EutUGMpH21+ibT/4gSISm/oZTTF86ssclXTKKfedWbxBYMRusyCtU/TQcoir1 Bft3e4g4oXsnskREHIMt1v6s5fIHa32a3QP7S1HReA4A8jAbEY5R0KirUCA9OkcQeha paMoJ+tgBDt7qdnYhpDjZdgoafFvmn2cx5yxnjfiNmTE0mJWjumpNHB+94K56CSYvT4 QXWpZlDJqw== Date: Wed, 27 Apr 2022 21:35:45 +0200 (CEST) From: Sysadmin Lists To: freebsd-ports@freebsd.org Message-ID: <168251995.115947.1651088145958@ichabod.co-bxl> In-Reply-To: References: Subject: Re: Fill a disk with more recent files List-Id: Porting software to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-ports List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports@freebsd.org X-BeenThere: freebsd-ports@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Andrea Venturoli X-Mailer: ContactOffice Mail X-ContactOffice-Account: com:312482426 X-Rspamd-Queue-Id: 4KpTWJ4FKQz3LXF X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=fail ("body hash did not verify") header.d=mailfence.com header.s=20210208-e7xh header.b=roJAwzfh; dmarc=pass (policy=quarantine) header.from=mailfence.com; spf=pass (mx1.freebsd.org: domain of sysadmin.lists@mailfence.com designates 212.3.242.68 as permitted sender) smtp.mailfrom=sysadmin.lists@mailfence.com X-Spamd-Result: default: False [-3.79 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:212.3.242.64/26]; R_DKIM_REJECT(0.00)[mailfence.com:s=20210208-e7xh]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[mailfence.com:-]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[212.3.242.68:from]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(0.00)[mailfence.com,quarantine]; MLMMJ_DEST(0.00)[freebsd-ports]; DMARC_POLICY_ALLOW_WITH_FAILURES(-0.50)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:10753, ipnet:212.3.242.64/26, country:US]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: N With a source disk containing x-amount of space, and a backup disk containing y-amount of space, where x > y, to back up files from x, newest first, until disk y is full, it's as simple as a bash-loop where you specify date ranges on each iteration: for days in {1..30}; do find source/ -type f -mtime -${days} -exec rsync --archive '{}' target/'{}' \; done - or - for days in {0..30}; do find source/ -type f \( -mtime +${days} -mtime -$(($days + 1)) \) -exec tar cf - '{}' + | tar xvf - -C target/ # and use '--strip-components n' to remove leading paths on target done There are advantages and disadvantages to each. > ---------------------------------------- > From: Andrea Venturoli > Sent: Wed Apr 27 09:47:40 CEST 2022 > To: > Subject: Fill a disk with more recent files > > > > Hello. > > Suppose I have a large storage of files and a smaller disk (backup). > I need to copy as much as I can from source to target and I want the > most recent files. > > Before I start scripting and reinvent the wheel, is there some tool already? > > bye & Thanks > av. > -- Sent with https://mailfence.com Secure and private email