rsync a file as it gets created and after 3 minutes old
- run a backup job
- The jobs creates partial files one after the other, about 2 minutes interval.
What i want to do is that while the job is still running or while a file was last modified or created 3 minutes ago, the
file should be rsync to a remote server untill the last file has been created and 3 minutes old.
I am learning how to script.
I have tried different options but no success
The closest i got was that the files were copied up to the current last file created and the script exited without waiting for the subsequent files to be created.
In other words i could not get the script to loop until it picked up all the files before exiting.
In my test i used ' echo " nohup rsync -a --inplace /mara/backup/mala$filename mara@tronic9922:/mara/backup/mara/ $ " >> thejobs ' instead of doing rsync dynamically.
But what i really need is to use rsync, to i can send each file to the remove server as it is created and its is 3 minutes old.
Hopefully someone can fix this for me or come up with a new script all together.
- see bottom for the files that get created.
Thanks
TRYING TO USE A WHILE LOOP AS THE BACKUP JOB IS RUNNING - this i could not figure it out.
Moderator's Comments:
Please do wrap your codes or samples in CODE TAGS as per forum rules.
Last edited by RavinderSingh13; 04-12-2019 at 02:02 AM..
Hi
Can some one please help me
How can i search a file which has been created or modified in last five minutes
I have used the command
find . -mmin -5
and it does not work
i get an error -mmin is bad option
Please help
Much regards
Tarun (2 Replies)
Hi ,
I need help in getting how many minutes ago the last file, matching some pattern in file name, was created in a folder.
Thanks in advance. (8 Replies)
I wanted to send an email to the client whenever there is failed record created in a /feed/HR-76/failed folder after processing of feed file.
I can find out with the help of below script that what is the new file created but that file didn't make just 15 minutes before.
... (1 Reply)
I wish to copy all the files & folder under /web/Transfer_Files/data/ on mymac1 (Linux) to remote server mybank.intra.com (Solaris 10) /tmp/ location
I am using Ansible tool synchronize module which triggers the unix rsync command as below:rsync --delay-updates -F --compress --archive --rsh=ssh... (2 Replies)
Hi, please help with below time conversion to minutes.
one column values:
2 minutes 16 seconds 420 msec
43 seconds 750 msec
0 days 3 hours 29 minutes 58 seconds 480 msec
11 seconds 150 msec
I need output in minutes(total elapsed time in minutes) (2 Replies)
Hi all,
System Ubuntu 16.04.3 LTS
i have the following log
INFO 2019-02-07 15:13:31,099 module.py:700] default: "POST /join/8550614e-3e94-4fa5-9ab2-135eefa69c1b HTTP/1.0" 500 2042
INFO 2019-02-07 15:13:31,569 module.py:700] default: "POST /join/6cb9c452-dcb1-45f3-bcca-e33f5d450105... (15 Replies)
Hello all,
Info:
System RedHat 7.5
I need to create a script that based on the creation time,
if the file is older then 5 minutes then execute some stuff, if not exit.
I thought to get the creation time and minutes like this.
CreationTime=$(stat -c %y /tmp/test.log | awk -F" " '{ print... (3 Replies)
A process xyz is running and creating file1, file2, file3, .... filen. how do i know if the process has stopped and createtime of the last file (filen) is older than 5 minutes?
OS is AIX (3 Replies)