file comparing
hi,
how to compare should be done between the files in the directory and the files on the server on different location if the file mismatch then it sent alert through bash script. Thanks |
Quote:
You can do an "ls -l" on a file locally, which will return the size/date, etc. On the remote, you can do it via ssh, like "ssh <user>@<address> 'ls -l <filename>'", then compare the two. And if you want to do this through Bash, I will AGAIN suggest you look at any one of the thousands of bash tutorials that are available through Google. |
if you let me know those thousand of tutorial address it will helpful for me tb1....
|
You can also use the DRY RUN capability of rsync. In DRY RUN mode rsync will show a list of the files that are going to be syncronized (files mismatch) without actually performing any action (files stay out of sync). Here is an example:
Code:
rsync -av --dry-run -e ssh /path/to/source/dir/ user@host:/path/to/destination/dir/ Code:
$ rsync -av --dry-run -e ssh /path/to/source/dir/ user@host:/path/to/destination/dir/ Code:
$ rsync -av --dry-run -e ssh /path/to/source/dir/ user@host:/path/to/destination/dir/ /path/to/source/dir/ /path/to/source/dir/file1 /path/to/source/dir/dir1/ /path/to/source/dir/dir1/file2 /path/to/source/dir/dir2/ /path/to/source/dir/dir2/file3 |
actually i have wrote a script to download files from ftp...ater downloading it will verify that is any file missed during download on weekly basis...
|
Quote:
Put in "bash script tutorial" Press "ENTER" |
All times are GMT -5. The time now is 10:50 AM. |