Page 1 of 1

The way FSArchiver interpret wildcard: *

Posted: Sat Jul 30, 2011 4:56 pm
by ddreamer
Under my home directory, there are visible files (whose names are not started with ".") and invisible files (whose names are started with "."). I want to backup all the invisible files in my home directory and exclude all the visible files by specifying "--exclude=/home_directory/*". But it turned out FSArchiver just did not back up any file in my home directory. Such interpretation is different from that in bash or sh shell environment. Will it be corrected or is there any way to achieve what I wanted ?

When the files are too many to be completely specified in the parameter of "--exclude=", could we provide a file listing the excluded files for FSArchiver to deal with ?

Re: The way FSArchiver interpret wildcard: *

Posted: Sat Jul 30, 2011 8:14 pm
by feffer777
From the man page:
-e pattern, --exclude=pattern
Exclude files and directories that match that pattern. The pattern can contains
shell asterisks such as * and ?, and the pattern may be either a simple file/dir
name or an absolute file/dir path. You must use quotes around the pattern each time
you use wildcards, else it would be interpreted by the shell. The wildcards must be
interpreted by fsarchiver. See examples below for more details about this option.
It seems that you must use quotes around the pattern when you use wildcards. Did you do that?

Regards,
feffer

Re: The way FSArchiver interpret wildcard: *

Posted: Sun Jul 31, 2011 1:51 am
by ddreamer
Yes, I did that. Actually, I found either "--exclude=.*" or "--exclude='.*'"(wildcards quoted) worked the same and worked well. They both backup visible files with explicit exclusion of invisible files started with ".". However, "--exclude=*" or "--exclude='*'" will exclude everything (visible files and invisible files). You can have a simple trial by "sudo fsarchiver -v --exclude=/home/$USERNAME/.java/'*' savedir ARCHIVE_NAME.fsa /home/$USERNAME/.java"

In addition, fsarchiver seemed not to recognize "~", since specifying "--exclude=/home/$USERNAME/.java/.*" and "--exclude=~/.java/.*" produced different results. The latter did not exclude anything.

Moreover, it takes the root priveledge to run fsarchiver, but the directory of /home/$USERNAME/.gvfs is accessible only to the $USERNAME but not to the root. Hence, "savedir" "/home/$USERNAME" would return errors related to ".gvfs". I tried to prevent the errors by specifying "--exclude=/home/$USERNAME/.gvfs" or "--exclude=/home/$USERNAME/.*" or "--exclude=/home/$USERNAME/'.*'". But they all failed.

Re: The way FSArchiver interpret wildcard: *

Posted: Sun Jul 31, 2011 7:29 am
by admin
fsarchiver considers paths literally, it does not interpret things such as "~" or "$VARIABLES". Exclusions of your home directories such as --exclude="/home/john/.gvfs" should work, so keep in mind that you have to provide the path relative to the root of the filesystem. So if you have a separate partition for /home, you have to exclude this way: --exclude="/john/.gvfs" as fsarchiver is reading "/john" inside the filesystem which is mounted on /home.

Re: The way FSArchiver interpret wildcard: *

Posted: Sun Jul 31, 2011 3:13 pm
by ddreamer
The command:

sudo fsarchiver -v savedir test.fsa /ddreamer/john --exclude="/ddreamer/.gvfs"

showed error message:

Analysing directory /home/ddreamer...
[errno=13, Permission denied]: oper_save.c#778,createar_save_directory(): cannot lstat64(/home/ddreamer/.gvfs)
[errno=13, Permission denied]: oper_save.c#1250,oper_save(): cannot run evaluation createar_save_directory(/home/ddreamer)
removed test.fsa

--exclude=/home/ddreamer/.gvfs
--exclude="/home/ddreamer/.gvfs"
--exclude='/home/ddreamer/.gvfs'
--exclude=/home/ddreamer/".gvfs"
--exclude=/home/ddreamer/'.gvfs'
--exclude=/ddreamer/.gvfs
--exclude=/ddreamer/'.gvfs'
--exclude=/ddreamer/".gvfs"
--exclude='/ddreamer/.gvfs'
--exclude="/ddreamer/.gvfs"
--exclude=.gvfs
--exclude='.gvfs'
--exclude=".gvfs"
ALL showed the same error message.

I used FSArchiver 0.6.8 under Ubuntu Lucid Lynx. All directories basically are in the same partition (type ext4), which is mounted as root.