Using the Linux command line, I use the scp command to copy up all the files and folders from a certain directory. However, I don't like to consume wasted bandwidth for copying up things I rarely change like my tiny_mce folder. What's the trick to copy up everything but skip a short list of folders?
views:
567answers:
4A great tool you may want to try out is "lftp".
lftp sftp://etc.etc/
lftp> ls
--- remote listing ---
lftp> mirror -R -n local/ remote/
You can also use RSync over ssh
rsync -avzp -e ssh /this/dir/ remoteuser@remotehost:/remote/dir/
Should work.
You could try rsync which only copies files that have changed, also works over ssh.
rsync works fine, and in most cases, uses SSH automatically as it's transport protocol. It will compare files and only upload those that have changed - but you can also use an exclude list to specify files in the tree that shouldn't be rsynced anyhow.
Rsync is a good solution, but if you're looking for an alternative:
Let's say, we have a directory "test" contain the directories "foo, bar, baz". In these dirs are a bunch of different file types:
test
|____bar
| |____1.jpg
| |____1.png
| |____1.txt
| |____2.jpg
| |____2.png
| |____2.txt
|____baz
| |____1.avi
| |____2.avi
| |____3.png
|____foo
| |____test.blah
|____test.txt
We want to copy everything except the PNGs
scp $(find /location/of/test -type f ! -name "*.png") # -> Note the logical NOT!!
In this example, the command will put all of the files into the same destination directory - this may not be the behavior you want.