12-07-2019
Hi RudiC,
Thank you for reverting.
Pls show how and where "SERVER-B ... will delete same".: either delete OR move to another directory.
Will all files 1 - 4 be deleted from server1 if all went well?: YES
Will they also be deleted from server2 if all went well?: YES, this is what we want to avoid duplicity(if SERVER1 goes DWON, SERVER-B will be pointed to SERVER2 and it should pick only those files which are not picked from SERVER1).
Does server-B have a list of files to copy? A list of files done and to be deleted?: NO - SERVER-B knows a directory on SERVER1 from where it will pick files and either delete it or ARCHIVE it to another directory.
SERVER-A(In fact it combination of 6 SERVERs - but not relevant to us) is generating lots of files, these files are pulled by SERVER1 and SERVER2 separately.
SERVER1 and SERVER2 are at two sites for redundancy.
SERVER-B picks files from SERVER1 and IF SERVER1 goes down it should pick files from SERVER2(but it should not pick the files already picked from SERVER1 - To avoid duplicity).
SERVER-B is another party - I need to check with them, Still please provide suggestion based on your assumption(It will delete or move to another directory).
Thank you.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Please help. Here is my problem. I have 9000 lines in file a and 500,000 lines in file b. For each line in file a I need to search file b and remove that line. I am currently using the grep -v command and loading the output into a new file. However, because of the size of file b this takes an... (4 Replies)
Discussion started by: mjs3221
4 Replies
2. Shell Programming and Scripting
Hi ,
i have three server
server1 -> Unix OS ,ftp enable IP ->10.8.219.190
server 2 -> Unix OS ,ftp enable
NIC 1 IP ->10.8.219.191 ,NIC2 ->192.168.0.5
server3 -> windows OS ,ftp enable NIC1 ->192.168.0.6.
hence server 1 and server 3 can not communicate ,but server 2 can... (1 Reply)
Discussion started by: suchintkotia
1 Replies
3. UNIX for Dummies Questions & Answers
Hello
i have the files in this format
pdb1i0t.ent
pdb1lv7.ent
pdb1pp6.ent
pdb1tj2.ent
pdb1xg2.ent
pdb2b4b.ent
pdb2ewe.ent
Now i have to remove the prefix pdb from all the files and also i need to change the extension of .ent to .txt
The new file should look like this
... (3 Replies)
Discussion started by: empyrean
3 Replies
4. Shell Programming and Scripting
hi
is there any way to append the file contents at server1 to another file in server2 by using scp.
right now am transferring files to the server2 and using cat command for appending... (2 Replies)
Discussion started by: aemunathan
2 Replies
5. Shell Programming and Scripting
Hi All,
I have some 50,000 HTML files in a directory. The problem is; some HTML files are duplicate versions that is wget crawled them two times and gave them file names by appending 1, 2, 3 etc after each crawl. For example, if the file index.html has been crawled several times, it has been... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies
6. Linux
Hi Team,
I have deleted a file accidentally by using rm command. I am not the root(admin) user. Can you please let me know how to get that .tex file? (2 Replies)
Discussion started by: darling
2 Replies
7. Shell Programming and Scripting
hi,
i have two servers in unix. say server1 and server2. my shell script is running on server1.
In server2, there is a directory (/etc/data/) which contains some text files.
I want to write the list of filenames in server2 in a file and display the file in server1.
In short, i want to... (3 Replies)
Discussion started by: Little
3 Replies
8. UNIX for Dummies Questions & Answers
Hi ALL,
Requirement:Connect server2 from server1 and get the list of files generate on currentdate .
Basically i need to check the files in server1 and server2 on currrent date is equal on each 1 hr frequency.
Can anyone help me on this.
Thanks in advance
Hari (2 Replies)
Discussion started by: psthariharan
2 Replies
9. Shell Programming and Scripting
Below is a flowchart of a program. Most everything works as expected, but there are a couple of issues that I need some expert help on. The check function was setup initially for a single user input. The input has been modified to allow for multiple inputs, so the code below does not work. My... (15 Replies)
Discussion started by: cmccabe
15 Replies
10. Shell Programming and Scripting
Hi All,
Is there is any machanisim, once delete the file can we restore it.
Thanks (8 Replies)
Discussion started by: bmk123
8 Replies
LEARN ABOUT DEBIAN
libmemcached_examples
LIBMEMCACHED_EXAMPLES(3) libmemcached LIBMEMCACHED_EXAMPLES(3)
NAME
libmemcached_examples - libmemcached Documentation
Examples for libmemcached
DESCRIPTION
For full examples, test cases are found in tests/*.c in the main distribution. These are always up to date, and are used for each test run
of the library.
CONNECTING TO SERVERS
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);
In the above code you create a memcached_st object with three server by making use of memcached_create().
CREATING A POOL OF SERVERS
Creating a pool of Servers:
const char *config_string= "--SERVER=host10.example.com --SERVER=host11.example.com --SERVER=host10.example.com";
memcached_pool_st* pool= memcached_pool(config_string, strlen(config_string));
memcached_return_t rc;
memcached_st *memc= memcached_pool_pop(pool, false, &rc);
.... do work
/*
Release the memc_ptr that was pulled from the pool
*/
memcached_pool_push(pool, memc);
/*
Destroy the pool.
*/
memcached_pool_destroy(pool);
In the above code you create a memcached_pool_st object with three server by making use of memcached_pool().
When memcached_pool_destroy() all memory will be released that is associated with the pool.
ADDING A VALUE TO THE SERVER
Adding a value to the Server:
char *key= "foo";
char *value= "value";
memcached_return_t rc= memcached_set(memc, key, strlen(key), value, value_length, (time_t)0, (uint32_t)0);
if (rc != MEMCACHED_SUCCESS)
{
... // handle failure
}
It is best practice to always look at the return value of any operation.
FETCHING MULTIPLE VALUES
memcached_return_t rc;
char *keys[]= {"fudge", "son", "food"};
size_t key_length[]= {5, 3, 4};
unsigned int x;
uint32_t flags;
char return_key[MEMCACHED_MAX_KEY];
size_t return_key_length;
char *return_value;
size_t return_value_length;
rc= memcached_mget(memc, keys, key_length, 3);
x= 0;
while ((return_value= memcached_fetch(memc, return_key, &return_key_length,
&return_value_length, &flags, &rc)))
{
free(return_value);
x++;
}
Notice that you freed values returned from memcached_fetch(). The define MEMCACHED_MAX_KEY is provided for usage.
HOME
To find out more information please check: http://libmemcached.org/
SEE ALSO
memcached(1)
AUTHOR
Brian Aker
COPYRIGHT
2011, Brian Aker DataDifferential, http://datadifferential.com/
1.0.8 May 22, 2012 LIBMEMCACHED_EXAMPLES(3)