Sponsored Content
Top Forums Shell Programming and Scripting Shell script to transfer the files from source to target server. Post 302277430 by Rhije on Friday 16th of January 2009 09:30:36 AM
Old 01-16-2009
Why not just use rsync? It can be a bit confusing.. but very very configurable!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

need a shell script to extract the files from source file and check whether those files existonserve

Hi, I am new to shell scripting.Please help me on this.I am using solaris 10 OS and shell i am using is # echo $0 -sh My requirement is i have source file say makefile.I need to extract files with extensions (.c |.cxx |.h |.hxx |.sc) from the makefile.after doing so i need to check whether... (13 Replies)
Discussion started by: muraliinfy04
13 Replies

2. Shell Programming and Scripting

Reconcilations script between Source and Target

Hi, I am new to DB2 and in need of urgent help. Here we have about 100 queries (SQL) that have been manually executed to retrieve totals from different tables and post it to Excel spreadsheet. Is there any way I can create a shell script as a wrapper and execute these queries and create a... (5 Replies)
Discussion started by: bhaskar v
5 Replies

3. Shell Programming and Scripting

Need shell script to compare directories and delete files on target server

Hello, I need help in writing the shell script for below mentioned case. There are 2 servers(server A, server B). A cronjob syncs files between these 2 servers. Existing script is copying files from A to B. This is done using the command rsync. However, the files are not deleted... (2 Replies)
Discussion started by: SravaniVedam11
2 Replies

4. Post Here to Contact Site Administrators and Moderators

How to count successfully copy files source to target location with check directory in Linux?

Hi guys...please any one help me .... how to copy files from source to target location if 5 files copied successfully out of 10 files then implement success=10 and if remaining 5 files not copied successfully then count error=5 how to implement this condition with in loop i need code linux... (0 Replies)
Discussion started by: sravanreddy
0 Replies

5. UNIX for Dummies Questions & Answers

How to count number files successfully copied from source to target location?

Hi Guys, how to count number of files successfully copied while coping files from source to destination path ex:10 files from source to target location copying if 8 files copied successfully then echo successfully copied=8 failure=2 files if two files get error to coping files... (2 Replies)
Discussion started by: sravanreddy
2 Replies

6. Shell Programming and Scripting

Help with script to transfer files from one server to another

Hi I have the following script: #!/bin/sh set -x touch -mt 201210040000 /tmp/ref1 touch -mt 201210042359 /tmp/ref2 find /fs1/bscsrtx/BSCS_ix/WORK/LOG -type f \( -newer /tmp/ref1 -a ! -newer /tmp/ref2 \) > file_lst scp $(< file_lst) root@10.100.48.76:/ano2005/fs1_2015/LOG/ but somehow its... (7 Replies)
Discussion started by: fretagi
7 Replies

7. Shell Programming and Scripting

Transfer files from one server with bash script

Hello to all, I want to copy from one server to another files of last 24 hours with size between 500MB and 2GB. The code below searches last files in 24 hours. find . -mtime -1 In order to copy faster I'd like to compress the files before copying them. How to automate the process of... (8 Replies)
Discussion started by: Ophiuchus
8 Replies

8. Shell Programming and Scripting

Shell scripting to transfer files from one to another server through ftps

Hi Guyz ,, I'm an ERP functional guy , I really need to automate a script which required a shell script but have a little knowledge in shell scripting. I need my generated files to be zipped first in one directory lets say (xyz) and then it needs to transfer another ftp server in... (3 Replies)
Discussion started by: Shogundion
3 Replies

9. Shell Programming and Scripting

Move multiple files 4rm Source to different target folders based on a series num in the file content

Dear Experts my scenario is as follows... I have one source folder "Source" and 2 target folders "Target_123456" & "Target_789101". I have 2 series of files. 123456 series and 789101 series. Each series has got 3 types of fiels "Debit", "Refund", "Claims". All files are getting... (17 Replies)
Discussion started by: phani333
17 Replies

10. UNIX for Beginners Questions & Answers

Automate splitting of files , scp files as each split completes and combine files on target server

i use the split command to split a one terabyte backup file into 10 chunks of 100 GB each. The files are split one after the other. While the files is being split, I will like to scp the files one after the other as soon as the previous one completes, from server A to Server B. Then on server B ,... (2 Replies)
Discussion started by: malaika
2 Replies
YPXFR(8)						    BSD System Manager's Manual 						  YPXFR(8)

NAME
ypxfr -- transfer NIS database from remote server to local host SYNOPSIS
/usr/libexec/ypxfr [-f] [-c] [-d target domain] [-h source host] [-s source domain] [-p path] [-C taskid program-number ipaddr port] mapname DESCRIPTION
The ypxfr utility copies an NIS database (or map) from one NIS server to another using NIS services. In FreeBSD, ypxfr is generally invoked by ypserv(8) when it receives a map transfer request from yppush(8). The ypxfr utility is used primarily in environments where several NIS servers are in use in a single domain. One server, the NIS master, maintains the canonical copies of all NIS maps, and all the other servers, the NIS slaves, copy new versions of the maps from the master whenever any updates are made (i.e., when a user updates their pass- word via yppasswd(1)). When run, ypxfr creates a temporary database file in /var/yp/[domainname], and fills it with the contents of mapname as supplied by the spec- ified source host. When the entire map has been transferred, ypxfr deletes the original copy of mapname and moves the temporary copy into its place. When the transfer is complete, ypxfr will attempt to send a 'clear current map' request to the local ypserv(8) process to clear any possible references it may still have to the stale map. Note that all files created by ypxfr are owner readable and writable only for security reasons. Since the NIS maps and the directory in which they reside are normally owned by root, this prevents non-privileged users from making unauthorized modifications. In order to maintain consistency across all NIS servers, ypxfr can be run periodically in a cron(8) job. Maps which change infrequently need only be updated once a day (preferably late at night when system usage is lowest), whereas those that are subject to frequent changes (such a passwd.byname and passwd.byuid) should be updated perhaps once every hour. Using cron(8) to automatically update the NIS maps is not strictly mandatory since all updates should be propagated by yppush(8) when /var/yp/Makefile is run on the NIS master server, however it is good practice on large networks where possible outages could cause NIS servers to fall out of sync with each other. When ypxfr is invoked without a controlling terminal, e.g. from inside ypserv(8), it logs all its output using the syslog(3) facility. NOTES
The FreeBSD version of ypxfr has support for a special map transfer protocol which works in conjunction with the FreeBSD rpc.ypxfrd(8) server. This protocol allows it to transfer raw map database files from the NIS master server and can be many times faster than the standard transfer method, particularly for very large NIS maps. The ypxfr utility will check to see if the rpc.ypxfrd(8) server is registered on the NIS master server and attempt to use it if it is present. If it is not it will fall back to the standard transfer method, copying the map contents from ypserv(8) and creating new maps instead. Note that while the FreeBSD ypxfrd protocol is conceptually similar to the SunOS ypxfrd protocol, the FreeBSD protocol is not compatible with Sun's, therefore it will not work with Sun's ypxfrd server. FreeBSD slave systems can still transfer maps from any non-FreeBSD NIS server, however they will only be able to take advantage of the faster protocol if the master server is also running FreeBSD. OPTIONS
The following options and flags are supported by ypxfr: -f Force a map transfer. Normally, ypxfr will not transfer a map if it determines that the NIS master's copy is not newer than the existing copy already on the local host: the -f flag forces a transfer regardless of which server's version is more recent. -c Do not send a 'clear current map' request to the ypserv(8) process running on the local host. This flag is normally used when invok- ing ypxfr manually on a machine that is not yet running ypserv(8). Without this flag, failure to contact the local NIS server will cause ypxfr to abort the transfer. -d target domain Specify a target domain other than the current NIS domain. -h source host Specify the name of the host from which to copy the NIS maps. This option is used to ensure that ypxfr only copies maps from the NIS master server. -s source domain Specify the domain from which to transfer a map, in the event that the transfer is being done across two different NIS domains. -p path Specify the top level directory containing the NIS maps. By default, this path is /var/yp. The -p flag allows you to specify an alternate path should you wish to store your NIS maps in a different part of the file system. The NIS server, ypserv(8), passes this flag to ypxfr if it too has been told to use an alternate path. -C taskid program-number ipaddr port These options are used only when ypxfr is invoked by ypserv(8) in response to a map transfer request initiated by yppush(8). In this instance, ypxfr needs to 'callback' to the yppush(8) process and interact with it, so yppush(8) passes to it an IP address ipaddr, port number port, registered program number program-number and a transaction ID taskid that it can use to contact the waiting yppush(8) process on the master server. mapname The name of the map to transfer. FILES
/var/yp/[domainname]/[maps] The NIS maps for a particular NIS domain. SEE ALSO
yp(8), yppush(8), ypserv(8) AUTHORS
Bill Paul <wpaul@ctr.columbia.edu> BSD
February 5, 1995 BSD
All times are GMT -4. The time now is 07:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy