From mboxrd@z Thu Jan 1 00:00:00 1970 From: Teemu Likonen Subject: Re: org back up Date: Wed, 17 Oct 2012 21:41:35 +0300 Message-ID: <878vb5q6u8.fsf@mithlond.arda> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:38859) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOYZ2-0002MS-LH for emacs-orgmode@gnu.org; Wed, 17 Oct 2012 14:41:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TOYYy-00037M-Nw for emacs-orgmode@gnu.org; Wed, 17 Oct 2012 14:41:56 -0400 Received: from mta-out.inet.fi ([195.156.147.13]:48905 helo=jenni1.inet.fi) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOYYy-00037D-Go for emacs-orgmode@gnu.org; Wed, 17 Oct 2012 14:41:52 -0400 In-Reply-To: (Sanjib Sikder's message of "Wed, 17 Oct 2012 23:55:12 +0530") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Sanjib Sikder Cc: emacs-orgmode@gnu.org Sanjib Sikder [2012-10-17 23:55:12 +0530] wrote: > #!/bin/bash > > mkdir -p /home/USERNAME/org/backup && \ > find $HOME -type f -name '*\.org' ! -path "/home/USERNAME/org/backup/*" \ > -exec cp -t /home/USERNAME/org/backup/ \{\} \; How about this: #!/bin/sh target=$HOME/org/backup mkdir -p "$target" && \ find "$HOME" -type f -name '*.org' ! -path "$target/*" \ -exec cp -t "$target" {} +