8

I tried the command:

 rsync -v --include-from=/path/to/list.lst /home/user /path/to/backup

list.lst contains for example

.gnupg/

.pki/

.gnome2/keyrings/

.mozilla/firefox/*.default/bookmarkbackups/

.mozilla/firefox/*.default/bookmarks.html

.mozilla/firefox/*.default/*.db

.mozilla/firefox/*.default/*.sqlite

and I get error on all strings with:

failed: No such file or directory

When I use --files-from for this, I get an error too. Can anybody help me use wildcards for this?

d-cubed
  • 115
  • 4
Edward
  • 181
  • 1
  • 1
  • 3

6 Answers6

4

You can go with include filters and --include-from: Complex includes/excludes with rsync

Or you can go with a find command:

cd
rsync -v --files-from <(find gnupg/ .pki/ .gnome2/keyrings/ \
  .mozilla/firefox/*.default/bookmarkbackups/ \
  .mozilla/firefox/*.default/bookmarks.html .mozilla/firefox/*.default/*.db \
  .mozilla/firefox/*.default/*.sqlite) \
 ~ /path/to/backup
Tobu
  • 4,437
  • 1
  • 24
  • 31
  • Must i use "find + cat" when i have list.lst with paths to files and directories? Can you give me an example? – Edward Jun 11 '10 at 15:16
  • I gave you an example. There is no cat, instead the list.lst was rewritten so that the shell matches your globs. If you rewrite list.lst into rsync filter rules, rsync will do the matching. – Tobu Jun 11 '10 at 15:32
2

I think you may need to add the --recursive option and use --files-from.

Dennis Williamson
  • 62,149
  • 16
  • 116
  • 151
1

I think the file name in your list.lst must start with + or - like:

- *.o
- foo/
+ *.exe
+ 123/456/*
splattne
  • 28,508
  • 20
  • 98
  • 148
myw58
  • 11
  • 1
1

One possible solution is described in the following web page. It looks like that error line is misleading, check the "code" error that comes latter.

http://kenfallon.com/rsync-mkstemp-failed-no-such-file-or-directory-2/

https://access.redhat.com/solutions/60592

I have similar problem with "(code 23)" but I am still don't know why or how to fix it. If I put the files to transfer (foo*.xml) in the command line rather than in the --files-from file, it works. I am starting to think that --files-from does not like patterns with asterisks, question marks, etc. Perhaps I need to use --include-from, the problem is that I found --include-from confusing to include and exclude files.

0 Success 1 Syntax or usage error 2 Protocol incompatibility 3 Errors selecting input/output files, dirs 4 Requested action not supported: an attempt was made to manipulate 64-bit files on a platform that cannot support them; or an option was specified that is supported by the client and not by the server. 5 Error starting client-server protocol 6 Daemon unable to append to log-file 10 Error in socket I/O 11 Error in file I/O 12 Error in rsync protocol data stream 13 Errors with program diagnostics 14 Error in IPC code 20 Received SIGUSR1 or SIGINT 21 Some error returned by waitpid() 22 Error allocating core memory buffers 23 Partial transfer due to error 24 Partial transfer due to vanished source files 25 The --max-delete limit stopped deletions 30 Timeout in data send/receive 35 Timeout waiting for daemon connection

Guasqueño
  • 241
  • 2
  • 5
  • We really do prefer that answers contain content not pointers to content. Whilst this may theoretically answer the question, [it would be preferable](http://meta.stackoverflow.com/q/8259) to include the essential parts of the answer here, and provide the link for reference. Link-only answers can become invalid if the linked page changes. – masegaloeh Dec 09 '14 at 15:01
0

It light of @seamus' comment: this answer explains the use of files-from and include-from.

Hipponax43
  • 101
  • 1
0

Make sure the lines in the /path/to/list.lst do not have blank spaces at the end of the line. I don't know why rsync is so sensitive to that.

Guasqueño
  • 241
  • 2
  • 5