Sponsored Content
Top Forums Shell Programming and Scripting Copy down remote files and rename them to include the server name with full path Post 302756189 by asnatlas on Tuesday 15th of January 2013 03:19:09 PM
Old 01-15-2013
THANK YOU VERY MUCH Chubler_XL

I had to add " " around the $server:$filepath for some reason.

Code:
OLDIFS=$IFS
IFS=":"
while read server filepath
do
   scp "$server:$filepath" $server${filepath//\//_}
done < new.list
IFS=$OLDIFS

Without the " " I was getting scp SERVER /path/path/file (No such file or directory)

Once I updated it to "$server:$filepath" I would get scp SERVER:/path/path/file

Thanks again for your help Smilie

---------- Post updated at 03:19 PM ---------- Previous update was at 11:02 AM ----------

I was getting the following error on some of the servers because I was using sudo find:

sudo: sorry, you must have a tty to run sudo

I just added ssh -t and that appears to have fixed it Smilie
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

rename files in remote server via ftp

Hi All, I want to rename set of files in the remote server which iam unable to do . i can rename only one file at a time . for example ftp $REMOTESERVER { rename $NAME1 $NAME2 } is working whereas ftp $REMOTESERVER { rename $NAME1*.dat $NAME2*.data } is not working ...... (4 Replies)
Discussion started by: dineshr85
4 Replies

2. Shell Programming and Scripting

copy files from remote server (B) to target server (A)?

Hi All, what is the comand to log off the remote server? I have 2 servers A, B. I need to find all files older than 7 days on server B and copy over to server A. My logic is: login the remote server: ================= ssh hostB cd /data/test find . -mtime -7 -ls | awk '{print... (4 Replies)
Discussion started by: Beginer0705
4 Replies

3. UNIX for Dummies Questions & Answers

Copy files from remote server

Hi Friends, Could you please help me as per my requirement mentioned below ? I have to copy files from one unix server to another unix server, and the files that i need to copy from the remote server are only those which are modified/created Today from abc directory on the remote server (1 Reply)
Discussion started by: ramask
1 Replies

4. UNIX for Dummies Questions & Answers

Can I copy files on remote server with ftp ?

I just realize the only way is to download and upload again.. is not possible to copy them remotely with the ftp protocol ? thanks (2 Replies)
Discussion started by: aneuryzma
2 Replies

5. Shell Programming and Scripting

make file (include files path)

Hi All, In make file i want to include header files from my local directory and if it did not find in local directory i want to include from network directory. can any help me how i can do this?. here is the code INCLUDE=${include}/ this is point to network dir how i can add option that it... (1 Reply)
Discussion started by: goraya430
1 Replies

6. UNIX for Dummies Questions & Answers

Checking files in remote server and decide to copy file or not

Hi there, I have a problem in my script, I need to check whether file exists in remote server or not, if the file exists, then stop copy else copy the file to the server.. my code is something like this while read $server do if ssh $server "cd $directory_name; if ; then echo "Error:... (2 Replies)
Discussion started by: beezy
2 Replies

7. UNIX for Dummies Questions & Answers

How to copy files from remote server to local?

Hi experts, I 'm newbie to unix world, now I have task to copy the latest files from remote server to my local. I believe this must be very common request in this community. I want you do it one more time for me please. My requirement is something like this: I receive files in the below... (3 Replies)
Discussion started by: parpaa
3 Replies

8. Shell Programming and Scripting

Rsync - how to copy hidden folder or hidden files when using full path

Hello. I use this command : rsync -av --include=".*" --dry-run "$A_FULL_PATH_S" "$A_FULL_PATH_D"The data comes from the output of a find command. And no full source directories are in use, only some files. Source example... (2 Replies)
Discussion started by: jcdole
2 Replies

9. Shell Programming and Scripting

Rename (move) multiple files on remote server using sftp

I want to rename (move) multiple files on remote server. I tried the following command to move all TXT files from my_dir directory to /new_dir. But it does not work. Any help? #!/bin/ksh sftp -dev3 << ABC cd my_dir $(for i in TXT; do echo "ls *.$i" ; rename $x /new_dir/$x;... (1 Reply)
Discussion started by: Soham
1 Replies
LIBMEMCACHED_CONFIGURATION(3)					   libmemcached 				     LIBMEMCACHED_CONFIGURATION(3)

NAME
libmemcached_configuration - libmemcached Documentation SYNOPSIS
#include <libmemcached-1.0/memcached.h> LIBMEMCACHED memcached_st *memcached(const char *string, size_t string_length) memcached_return_t libmemcached_check_configuration(const char *option_string, size_t length, char *error_buffer, size_t error_buffer_size) Compile and link with -lmemcached DESCRIPTION
Libmemcached implements a custom language for configuring and modifying servers. By passing in an option string you can generate a mem- cached_st object that you can use in your application directly. --SERVER=<servername>:<optional_port>/?<optional_weight> Provide a servername to be used by the client. Providing a weight will cause weighting to occur with all hosts with each server getting a default weight of 1. --SOCKET="<filepath>/?<optional_weight>" Provide a filepath to a UNIX socket file. Providing a weight will cause weighting to occur with all hosts with each server getting a default weight of 1. --VERIFY-KEY Verify that keys that are being used fit within the design of the protocol being used. --REMOVE_FAILED_SERVERS Enable the behavior MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS. --BINARY-PROTOCOL Force all connections to use the binary protocol. --BUFFER-REQUESTS Enable MEMCACHED_BEHAVIOR_BUFFER_REQUESTS. --CONFIGURE-FILE= Provide a configuration file to be used to load requests. Beware that by using a configuration file libmemcached will reset memcached_st based on information only contained in the file. --CONNECT-TIMEOUT= Enable MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT. --DISTRIBUTION= Set the distribution model used by the client. See :manpage:`` for more details. --HASH= Set the hashing alogrthm used for placing keys on servers. --HASH-WITH-NAMESPACE When enabled the prefix key will be added to the key when determining which server to store the data in. --NOREPLY Enable "no reply" for all calls that support this. It is highly recommended that you use this option with the binary protocol only. --NUMBER-OF-REPLICAS= Set the nummber of servers that keys will be replicated to. --RANDOMIZE-REPLICA-READ Select randomly the server within the replication pool to read from. --SORT-HOSTS When adding new servers always calculate their distribution based on sorted naming order. --SUPPORT-CAS See memcached_behavior_set(3) for MEMCACHED_BEHAVIOR_SUPPORT_CAS --USE-UDP See memcached_behavior_set(3) for MEMCACHED_BEHAVIOR_USE_UDP --NAMESPACE= A namespace is a container that provides context for keys, only other requests that know the namespace can access these values. This is accomplished by prepending the namespace value to all keys. Mecached Pool Options: --POOL-MIN Initial size of pool. --POOL-MAX Maximize size of the pool. I/O Options: --TCP-NODELAY See memcached_behavior_set(3) for MEMCACHED_BEHAVIOR_TCP_NODELAY --TCP-KEEPALIVE See memcached_behavior_set(3) for MEMCACHED_BEHAVIOR_TCP_KEEPALIVE --RETRY-TIMEOUT= See memcached_behavior_set(3) for MEMCACHED_BEHAVIOR_RETRY_TIMEOUT --SERVER-FAILURE-LIMIT= See memcached_behavior_set(3) for MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT --SND-TIMEOUT= See memcached_behavior_set(3) for MEMCACHED_BEHAVIOR_SND_TIMEOUT --SOCKET-RECV-SIZE= See memcached_behavior_set(3) for MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE --SOCKET-SEND-SIZE= See memcached_behavior_set(3) for MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE --POLL-TIMEOUT= That sets the value of the timeout used by :manpage: poll(). --IO-BYTES-WATERMARK= --IO-KEY-PREFETCH= --IO-MSG-WATERMARK= --TCP-KEEPIDLE --RCV-TIMEOUT= Other: INCLUDE Include a file in configuration. Unlike --CONFIGURE-FILE= this will not reset memcached_st RESET Reset memcached_st and continue to process. END End configutation processing. ERROR End configutation processing and throw an error. RETURN
memcached() returns a pointer to the memcached_st that was created (or initialized). On an allocation failure, it returns NULL. EXAMPLE
const char *config_string= "--SERVER=host10.example.com --SERVER=host11.example.com --SERVER=host10.example.com" memcached_st *memc= memcached(config_string, strlen(config_string); { ... } memcached_free(memc); HOME
To find out more information please check: http://libmemcached.org/ SEE ALSO
memcached(1) libmemcached(3) memcached_strerror(3) AUTHOR
Brian Aker COPYRIGHT
2011, Brian Aker DataDifferential, http://datadifferential.com/ 1.0.8 May 22, 2012 LIBMEMCACHED_CONFIGURATION(3)
All times are GMT -4. The time now is 03:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy