Visit The New, Modern Unix Linux Community

Rsync from remote machine via ssh and sync by uisng find by modified time

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Rsync from remote machine via ssh and sync by uisng find by modified time
# 1  
Rsync from remote machine via ssh and sync by uisng find by modified time


I have a requirement to rsync from remote to local machine via ssh and sync files that are changed in last n hours.
pgrep to check if no other sync is running

pgrep -f rsync.*/opt > /dev/null || rsync --bwlimit=10000 -avz --delete root@X.X.X.X:/var/source/ /opt/dest/   >> /home/log 2>&1

Due to limitations on destination machine sync job needs to be run on local machine

Please can some one help me with this

Thanks in advance

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #951
Difficulty: Medium
The first known description of a self-reproducing computer program in science fiction was in a short story written in 1970.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Input to while loop in remote machine using ssh

Hello I am writing a script in a local machine, i am using ssh, here i am not able to using back ticks & input file to while loop. here is my script ssh -q server1 a=`ps -ef | grep ccms | awk {print $1}` b=`ps -ef | grep mss | awk {print $1}` # above lines are not working, so i redirected... (12 Replies)
Discussion started by: nanz143
12 Replies

2. Linux

Executing a script in remote machine through ssh

How to execute a script in remote machine through ssh I have a script which does some backup activity in remote machine. Wanted to keep backup also in remote machine. ssh -l username <remote machine> "commands to be exceuted as ; separted" but how to put the script in the place of... (5 Replies)
Discussion started by: sanvel
5 Replies

3. Red Hat

iptables applied in local machine, can't ssh remote machine after chain changed to DROP

I want to SSH to Server from my machine, my ip was Source Destination was UP, with IP This is LAN Network there are 30 Machine's Connected to the network and working fine, I'm Playing around the local machine's because I need to apply the same rules in... (2 Replies)
Discussion started by: babinlonston
2 Replies

4. Red Hat

Best way to sync time on a Linux machine

I wanted to know which should be the best way to sync time for a linux machine. We have an application server and a database server, both using RHEL 5.8 as the OS. It is important that the time on both these servers match together and also sync with a common time source. As per my knowledge, these... (11 Replies)
Discussion started by: RHCE
11 Replies

5. Shell Programming and Scripting

Cannot create variables via ssh on remote machine

Hello to all Background info: Local machine : Linux, /bin/bash Remote machine (for the user used for ssh) : SunOs, /bin/ksh (so we have different OS, different Shells) My problem : From the local host i execute $ var=bla $ result=$(ssh -q user@remote-machine " > echo \"this is... (12 Replies)
Discussion started by: black_fender
12 Replies

6. UNIX for Dummies Questions & Answers

/dev/tty find last modified time

what can I use to find the last modified time of a /dev/tty ? (4 Replies)
Discussion started by: l flipboi l
4 Replies

7. Shell Programming and Scripting

ssh connection from remote machine in solaris

Hi! I have two solaris 10 machines(say, i have installed rsync on, Sun Microsystems Inc. SunOS 5.10 Generic January 2005 -bash-3.00$ ssh "echo $PATH" Password:... (4 Replies)
Discussion started by: dddkiran
4 Replies

8. Red Hat

To find the LATEST file from a dir on REMOTE machine and SCP to local machine?

Hi All, URGENT - Please help me form a scipt for this: I need the LATEST file from a dir on REMOTE machine to be SCP'd to a dir on local machine. (and I need to execute this from local server) I know that the below cmd is used to find the LATEST file from a dir. But this command is not... (3 Replies)
Discussion started by: me_ub
3 Replies

9. Red Hat

how to find the red hat servers in time sync

Hi all, Before i'm going to install application on my RHEL servers, I just wanted make sure servers in time sync. How can I find it. Thanks. (1 Reply)
Discussion started by: s_linux
1 Replies

10. Shell Programming and Scripting

executng program on remote machine using ssh

I am trying to search and remove files from a list of servers. I want to find every occurence of this file on each machine and then remove it. If I execute the find command on the remote machine I would like to be able to pipe the output to xargs and remove the file. Does anyone know hat would be... (1 Reply)
Discussion started by: sewood
1 Replies
sync(2) 							   System Calls 							   sync(2)

sync - update super block SYNOPSIS
#include <unistd.h> void sync(void); DESCRIPTION
The sync() function writes all information in memory that should be on disk, including modified super blocks, modified inodes, and delayed block I/O. Unlike fsync(3C), which completes the writing before it returns, sync() schedules but does not necessarily complete the writing before returning. USAGE
The sync() function should be used by applications that examine a file system, such as fsck(1M), and df(1M), and is mandatory before rebooting. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
df(1M), fsck(1M), fsync(3C), attributes(5), standards(5) SunOS 5.11 5 Jul 1990 sync(2)

Featured Tech Videos