How do we know that uploading local file to google drive suceesed in the programming?

What is the problem you are having with rclone?

I am coding with c# to upload the local file to google drive.
My code is as below.

        Process process = new Process();
        process.StartInfo.FileName = _fname;
        process.StartInfo.Arguments = "rclone copy " + _localFile + " " + _cloud;
        ...
        process.StartInfo.RedirectStandardOutput = true;
        process.StartInfo.RedirectStandardError = true;

        process.Start();
        process.WaitForExit();

        //checking the result of executing rclone command
        output = process.StandardOutput.ReadToEnd();
        error = process.StandardError.ReadToEnd();

Q: How do we know that uploading local file to google drive succeed in the programming?
If there is no error in the [process.StandardOutput] and [process.StandardError], is it succeed to upload?
Do I need to check the file is exist in the Google Drive?

What is your rclone version (output from rclone version)

v1.53.1

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Windows 10, 64 bit

Which cloud storage system are you using? (eg Google Drive)

Google Drive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

Paste command here

The rclone config contents with secrets removed.

Paste config here

A log from the command with the -vv flag

Paste  log here

Best to check the exit code, possibly in combination with --error-on-no-transfer if that is what you want.

hi,
each time my scripts runs rclone, it

  • checks the error code
  • scans the rclone debug log file for text such as ERROR

Thank for your reply!
How can I check the exit code in my program with c#?

Thank for you reply!
How can I check the rclone debug log file with c#?

process.ExitCode contains the exit code value, after your process.WaitForExit.

Thanks a lot again.
I will try it.

I actually run a cryptcheck after all my copy to google drive commands. It's never found an error that was google's fault (Except on files above 50gb in size a long time ago before I broke files into smaller chunks).

It did actually serve as a very silly way to run memtest86 though :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.