If you want to execute it regularly, just use crontab under Linux.
But I think that in order to improve the availability of online mongoDB, it is most appropriate to use replica sets. When a mongo instance hangs, it automatically switches to the exception one. Also, in certain scenarios, replica sets can improve read performance. Of course, the premise is that you have extra machines.
mongodump does not seem to have a timing option, but it is possible if the operating system is used. For example, in Linux, you can use the vi editor to edit and execute mongodump -u -p -d -h, and then use the crontab command to start vi regularly to achieve the purpose of scheduled backup.
If you want to execute it regularly, just use
crontab
under Linux.But I think that in order to improve the availability of online mongoDB, it is most appropriate to use replica sets. When a mongo instance hangs, it automatically switches to the exception one. Also, in certain scenarios, replica sets can improve read performance. Of course, the premise is that you have extra machines.
mongodump does not seem to have a timing option, but it is possible if the operating system is used. For example, in Linux, you can use the vi editor to edit and execute mongodump -u -p -d -h, and then use the crontab command to start vi regularly to achieve the purpose of scheduled backup.