Logging errors using rsync and the -log-file option

We are having problems with the client SAN storage and the files "disappear" when sync is stored. We have a custom 4D database that runs a simple script to sync files from one location to another via rsync.

The script is executed: "rsync -rvuE --log-file = / tmp / rsync.log SRC DST". The problem is that rsync reports "rsync warning: some files disappeared before they can be migrated (code 23)". This error only appears in terminal / STDOUT and system.log. However, it doesn't appear in the -log folder of the file. I would like to post it to rsync.log because we read the log for completion and errors and report it to the user.

Now here is the tricky part, we cannot redirect STDOUT or STDERR to the log as it blocks the server.

+3


source to share


3 answers


Have you tried nohup? What will stdout and stderr capture? You can also grep in the system.log file for the error message and then add it to the log file.



0


source


I back up using rsync

several times a day (via an automated tool). I did grep

through my backup logs. My logs show that rsync

by default it archives the missing files to its log file. I am not using --log-file-format

or any other option that changes the format of the log file.

It looks like this:



2012/08/17 19:00:28 [12861] file has vanished: "foo"

      

I can find other errors logged there, such as files that cannot be transferred due to permissions. The date above is the actual date in the oldest log file I have that shows this type of error. The version rsync

I was using at the time was 3.0.9, so rsync

it has been doing it ever since.

0


source


4D creates .tmp files if there is a lack of memory - and deletes them again. This happens in the 4D data folder. Exclude it from your sync. Just sync your 4D backup files. Synchronizing an open 4D data file fails anyway ... the server writes all the time.

Peter

-1


source







All Articles