powershell script to copy files to webdav with Rclone

Muhasseena T U 1 Reputation point
2020-11-10T05:45:14.98+00:00

Hi,
I am not having that much knowledge in PowerShell. I have to transfer some backup files from My server to WebDAV through rclone.searched and got some documents regarding rclone configuration

https://rclone.org/webdav/

Initialy I have executed the the following script.

Invoke-Expression ((Invoke-WebRequest -Uri "https://gist.githubusercontent.com/justusiv/1ff2ad273cea3e33ca4acc5cab24c8e0/raw").content)
$silent = mkdir c:\rclone -ErrorAction SilentlyContinue
install-rclone -location c:\rclone

Please any one guide me , how to do PowerShell script to achieve my requirement.

Thanks in advance

Muhasseena

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,504 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ian Xue (Shanghai Wicresoft Co., Ltd.) 36,086 Reputation points Microsoft Vendor
    2020-11-10T06:48:54.683+00:00

    Hi,

    According to your document, you have to run config to add a remote after installing. Add that line to your current installation script

    Invoke-Expression ((Invoke-WebRequest -Uri "https://gist.githubusercontent.com/justusiv/1ff2ad273cea3e33ca4acc5cab24c8e0/raw").content)  
    $silent = mkdir c:\rclone -ErrorAction SilentlyContinue  
    install-rclone -location c:\rclone  
    c:\rclone\rclone.exe config  
    

    Once the configuration is done, to copy the local directory (e.g., c:\test) to an WebDAV directory called backup, just run

    c:\rclone\rclone.exe copy c:\test remote:backup  
    

    Best Regards,
    Ian

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.