mongodump command with timestamp query
I was able to achieve what I wanted by the suggestions given in the comments by @WernfriedDomscheit and @prasad_

Now my mongodump command is as below

mongodump -h 127.0.0.1:27018 -d local -c oplog.rs --query "{\"ts\":{\"\$gt\":{\"\$timestamp\":{\"t\":${TIMESTAMP_LAST_OPLOG_ENTRY},\"i\":${INC_NUMBER_LAST_OPLOG_ENTRY}}}}}" -o - &gt; ${OUTPUT_DIRECTORY}/${TIMESTAMP_LAST_OPLOG_ENTRY}_${INC_NUMBER_LAST_OPLOG_ENTRY}_oplog.bson 2&gt;&gt; "$LOG_FILE"


"TIMESTAMP_LAST_OPLOG_ENTRY" and "INC_NUMBER_LAST_OPLOG_ENTRY" are being fetched from the previous '.bson' file.

Thanks,
Rahul Paryani