【问题标题】:Synchronize files from current year to FTP from Windows将当年的文件从 Windows 同步到 FTP
【发布时间】:2018-05-29 12:07:09
【问题描述】:

我一直在使用一两个批处理文件将较新的照片和文件复制到映射驱动器WD MyCloud,有点像这样:

robocopy "D:\OneDrive\Pictures\Camera Roll" "X:\Media\Digital Images\2018\Photos" /XF *.mp4 *.png *.dng /MAXAGE:20180101 /MINAGE:20181231 /S /E /XO /R:0 /W:0 /MT:32

这显然将文件限制为2018 中的文件。我还有很多人!

我发现MyCloud 的这种方式很慢,我想改用FTP

我已经看到 PowerShell 上的帖子作为一种潜在的解决方案,但如果这能满足我的需要,我无法理解。

有没有一种很好、有效的方法可以用可以使用FTP 的东西来替换RoboCopy 命令和开关?

【问题讨论】:

    标签: batch-file ftp synchronization robocopy


    【解决方案1】:

    您可以使用WinSCP FTP client

    使用批处理文件,例如:

    winscp.com /ini=nul /log=ftp.log /command ^
        "open ftp://username:password@ftp.example.com/" ^
        "put -filemask=*>=2018-01-01 ""D:\OneDrive\Pictures\Camera Roll\*"" ""/ftp/path/""" ^
        "exit"
    

    如果您想同步文件(仅上传 FTP 尚不存在的文件),请添加 -neweronly switch to the put command

    或者,如果您需要更大的灵活性,也可以使用synchronize command

    winscp.com /ini=nul /log=ftp.log /command ^
        "open ftp://username:password@ftp.example.com/" ^
        "synchronize remote -filemask=*>=2018-01-01 ""D:\OneDrive\Pictures\Camera Roll"" ""/ftp/path""" ^
        "exit"
    

    一些参考资料:

    (我是 WinSCP 的作者)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-10-22
      • 1970-01-01
      • 2015-10-03
      相关资源
      最近更新 更多