-2

I want to deploy a list of file from inside a file let's say files.lst:

+ .profile
+ .hg/hgrc
+ .mc/*
- /*

rsync -vvltr . --include-from 'files.lst' . destdir

Desired behaviour:

  • copy recusively all the files and directories from .mc
  • copy only .hg/hgrc file to destination, ignoring other files that could exist in that directory
  • copy .profile
5
  • You mean john@server: right? Otherwise, it would try to sync to a directory called 'john@server' and fail.
    – Kyle Smith
    Apr 18, 2012 at 14:14
  • 1
    Could you define doesn't work proper? Wrong files? To many files? Wrong location? Because the --include-files file.LIST // --include FILE is the way to go.
    – Tabakhase
    Apr 18, 2012 at 14:15
  • 1
    Did you really ask anyone in here to test before post? Is this a joke?!
    – pfo
    Apr 18, 2012 at 14:32
  • @pfo it wasn't a joke, it's so easy to add a meaningless comments instead of verifying that what you think really works.
    – sorin
    Apr 18, 2012 at 14:41
  • -1 for thinking this was an "Average User" site.
    – Tim
    Apr 18, 2012 at 15:34

2 Answers 2

1

Finally, I managed to make it working, definitely I would never recommend rsync to any average PC user (the one that never heard of man or SF).

+ .profile
+ .mc
+ .mc/***
+ .hg
+ .hg/hgrc
- /***

Explanations:

  • you need to specify the directory first because otherwise it skip them
  • the last line tells rsync to exclude everything that wasn't explicitly included.
7
  • You mean any average user who doesn't know how to RTFM. Apr 18, 2012 at 14:49
  • 1
    Dude, you have an attitude problem which we call trolling, man was the first thing I opened and it does not include information about the patters and how they work. Instead I managed to find the solution on another question on SF, but after spending too much time for a simple problem like this.
    – sorin
    Apr 18, 2012 at 14:57
  • 2
    I would recommend rsync to any Linux/UNIX system user for this purpose, it's a fantastic tool. Like most fantastic tools, it requires some patience and learning.
    – Kyle Smith
    Apr 18, 2012 at 15:08
  • What would you recommend? Windows Exploder?
    – Tim
    Apr 18, 2012 at 15:33
  • I must agree with @SorinSbarnea: Only above-average people use rsync. ;-) . Apr 18, 2012 at 15:40
0

You want the --files-from option.

rsync --files-from=files.lst destination:/location/

man rsync

Not the answer you're looking for? Browse other questions tagged .