I am new to the unix scripting. Please help me out for solving the condition given below
I am trying to develop a script for Copying files which are getting generated in server A to server B using scp. In serverA files are generating as for eg abc1.txt, abc2.txt, abc3.txt.... . I need to append these file contents to a single file in ServerB. Whenever new files are getting generated in the ServerA those file content details need to be appended at the end of the single file in serverB.
I would concatenate the info in a temporal file in server A, when you consider that the file is finished. you send with scp to server B .... and delete the file in server A.
I think , thats not the info you are looking for. In pseudo_code:
while (exit condition) {
if {new file created} { # test with ls output
cat new_file >> temporal_file
} else {
do nothing
}
scp ./temporal_file user@serverB:/path
rm temporal_file
Thanks for your reply . I find this logic as a good one. since i m new to scripting can you please explain me in little bit more detail mannner on how to perform this
If you cant transform pseudocode in code you may consider move this post to Newbies Forum. You are supposed to code that script in this forum....or thats what i think. If dont Scrutinizer has code to you another way to do it.