Windows定时任务copy到nfs目录

@echo off
mount 192.168.5.10:/data/test x:
xcopy /y "D:ackupmysql20200316_230000.sql.tar.gz" x:
umount x:

如代码所示,在定时任务中进行nfs挂载,然后再进行复制,复制完成后卸载nfs目录。可以满足再定时任务中复制文件到nfs目录的需要。

如果提前挂载好nfs目录,在定时任务执行时,应该会找不到该目录,导致复制失败。

原文地址:https://www.cnblogs.com/justbeginning/p/12510794.html