How to backup bulk images through code, uploaded by clients on a windows cloud server?
Loading
How to backup bulk images through code, uploaded by clients on a windows cloud server?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jithu ThomasPosted Feb 10, 2024, 6:00 AM
you can achieve this using a C# console applicaiton on the windows server: -
Tuhin PaulPosted Mar 11, 2024, 10:41 AM
You're currently checking if the source folder exists, which is good. However, you may also want to check if the backup folder exists and handle scenarios where it already exists or create a new folder with a different timestamp.
Tuhin PaulPosted Mar 11, 2024, 10:40 AM
C# console application for backing up images looks well-structured and functional.
While you have a general catch block to handle exceptions, it's better to handle specific exceptions individually to provide more meaningful error messages. For instance, you can handle IOException, UnauthorizedAccessException, etc., separately. If the backup folder already contains a file with the same name as the file being copied, it will be overwritten. You might want to check if the file exists in the destination folder and decide whether to overwrite it, skip it, or rename it.
Shweta VarshneyPosted Feb 22, 2024, 7:40 AM
I used bash command but it give error command not found
#! /bin/bash
$sourcePath = "\\cloud server\shared\folder"
$destinationPath = "E:\backup"
robocopy $sourcePath $destinationPath /E /Z /COPYALL /R:3 /W:2
Write-Host "Backup completed!"
What should I do? Please suggest.
Shweta VarshneyPosted Feb 17, 2024, 12:11 PM
Jithu ThomasPosted Feb 10, 2024, 8:25 AM
YES!!! It is possible... it can be done in many ways as follows: -
Cloud Storage Services
Remote Desktop Connection
FTP
Backup Software:
VPN or Direct Connection:
Using Powershell/Commond promopt: -
/E: Copies subdirectories, including empty ones./Z: Uses restartable mode. If the copy is interrupted,robocopywill resume where it left off./COPYALL: Copies all file information, including attributes, timestamps, and security information./R:3: Specifies the number of retries on failed copies (adjust as needed)./W:2: Specifies the wait time between retries in seconds (adjust as needed).Make sure to replace
\\cloud-server\Share\Folderwith the actual path on your cloud server and"E:\Backup"with the path on your local laptop or external hard disk.Shweta VarshneyPosted Feb 10, 2024, 8:16 AM
Is it possible to backup from cloud windows server to my laptop or external harddisk?