[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: a script to just back up files in a folder



Greetings,

I'm not certain that I understand the question.  If you run:
    tarsnap -c -f myname ~
or maybe
    tarsnap -c -f myname /Users/sa/
then it will back up all the files and directories of your user
account.  Are you trying to automatically exclude all
sub-directories from being backed up?  Unfortunately there is no
way to do this; you would need to specify (with "exclude") all of
the directory names that you do not want to back up.

If that wasn't what you were asking about (and I suspect that I
have misunderstood it), could you rephrase the question?


Another option that might be helpful: if you use the -T (or
--files-from) option, you can specify a file which contains a list
of files or directories.  That way, if you put this line inside
your tarsnap.conf:

    files-from /Users/sa/.tarsnap/filelist.txt

and create /Users/sa/.tarsnap/filelist.txt with:
    /Users/sa/
    /Users/another-person/

then it will back up those two directories without you needing to
specify them on the command-line.

(note: the long command "--files-from" is not in the man page yet,
but the -T command is there.  I'll add it soon.)

Cheers,
- Graham

On Wed, Jun 08, 2016 at 04:53:08PM -0700, Sarah Alawami wrote:
> Hello to all. I set up my scripts for my home folder to back up only what I want. Is there a way though to back up only the files at my root ~ directory? Can I create a script that just backs up the files that should go in the root or what do I need to do in this case? Not everything in my ~ directory is in a folder so wanted to know what would be the best way of going about this.
> 
> Thanks all and be blessed.