#!/bin/sh
/home/kaifa/mongodb/bin/mongodump -h xxxxxx:27017 --directoryperdb -d hems_online -o /data01/backup/
cd /data01/backup/
tar zcvf hems_online_$(date -d today %Y%m%d).tar.gz hems_online
rm -rf /data01/backup/hems_online
find /data01/backup/ -name "hems_online*" -type f -mtime 5 -exec rm -rf {} ;