Hello, I am trying to configure rclone to mount a S3 bucket and do a backup of a SQL Server database. We have servers in different domains and have service accounts that are specific to them. We are able to mount the S3 backet, but can't backup the database. Below is the entire block of commands that we are using.
...
F:\rclone\rclone mount test:crico-sql-prod z: --vfs-cache-mode writes --allow-other --config=c:\temp\rclone\rclone.conf --log-file f:\rclone\rclone.log --log-level DEBUG
timeout /t 10
mkdir z:\backup
sqlcmd -S CWIPDB1.rmfprod.local -E -d sqlmonitor -b -i "H:\MSSQL\backup.sql"
...
We created a SQL Server agent job and ran the job. The issue seems to be that SQL Server cant know that the drive has been mounted and is waiting. We tried to use a batch file with the mount command in it and then tried to do a backup from SQL Server Management Studio. Seems the OS cant find the Z: drive even though we see it under windows explorer. I also want to know if rclone works when the the user account and the service account are in different domains. Any help is very much appreciated.
What is your rclone version (output from rclone version)
V1.53.2
Which OS you are using and how many bits (eg Windows 7, 64 bit)
Microsoft Windows 2013, 64 bit
Which cloud storage system are you using? (eg Google Drive)
AWS
The command you were trying to run (eg rclone copy /tmp remote:tmp)
However the issue is that the mounted drive remains mounted. We want to unmout the drive once the backup is done. Currently we just kill the process by killing it in the taks manager.
We tried to mount the drive and backup the database by running a batch file with the same command i mentioned above. The content of the batch file is below.
We tried to run the batch file, I can see the drive mounted, the backup folder created but no database backup. Seconds later the command prompt window disappears. When i mount the drive again, i don't see the backup folder. I also noticed the rclone process in the Windows Task Manager running. I was under the impression that when the command prompt window closes, it also closes the rclone processs which does not seem to be the case.
I will keep trying but hope to get some help here.
We are now able to mount and unmount the S3 backet. However when we try to backup the databases, it would only allow us to backups a certain number of databases before the backup job fails with the below error.
Operating system error 1117(The request could not be performed because of an I/O device error.).
I read that Amazon recommends splitting using multipart uploads for uploading files that are 100mb or more. I could not find anything about multipart upload for rclone. Any help is very much appreciated.
We are using a SQL Server Agent job to mount and unmount the drive. We however have to make it work through our Job Scheduler.
The backup is failing exactly after a specific number of database backups. When we try it a second time, it fails after doing a couple of database backups.
We are doing backups of multiple databases but the biggest database backup is 800MB.
\C:\Users\svc_h12xmapsdevdb1_s\AppData\Local\rclone\vfs\test\crico-sql-prod\DEV\H12XMAPSDEVDB1\RMFPROD\mart_rmf_AON\mart_rmf_AON_FULL_20210211_085602.bak: There is not enough space on the disk.
Does this mean that rclone is using the C: drive for caching purposes?
Oh Ok. That would be a big issue for us as we would need a lot of space. Our database backups are big and a couple of them are between 300-400GB. Can we backup the databases directly by removing the cache-mode and if so how would that affect the backup uploads?
You can try with --vfs-cache-mode off but unless the backup script writes the file sequentially without seeking back and forth in it, then this will fail.
We disabled the cache mode and tried to backup the database. And our backup script backups the database one after the another. However the backup failed with this error.
2021/02/12 06:07:44 DEBUG : DEV/H12XMAPSDEVDB1/RMFSPROD/DIFDB/DIFDB_FULL_20210212_060730.bak: aborting in-sequence write wait, off=500178944
2021/02/12 06:07:44 DEBUG : DEV/H12XMAPSDEVDB1/RMFSPROD/DIFDB/DIFDB_FULL_20210212_060730.bak: failed to wait for in-sequence write to 500178944
2021/02/12 06:07:44 ERROR : DEV/H12XMAPSDEVDB1/RMFSPROD/DIFDB/DIFDB_FULL_20210212_060730.bak: WriteFileHandle.Write: can't seek in file without --vfs-cache-mode >= writes
2021/02/12 06:07:44 DEBUG
Seems rclone is still looking for the cache mode to be available.
Yes, it seems that the backup script seeks in the files when reading so --vfs-cache-mode writes is necessary.
Does the backup tool have a streaming write capability? For example in the unix world you might use tar - this can stream its output to stdout which you can then pipe into things. Rclone can take output like this and upload it, eg tar cvzf - /backup | rclone rcat remote:backup.tar.gz or if you have a streamed output then you can use --vfs-cache-mode off.
Failing that you'll have to find temporary disk space for one backup.
If you set --vfs-cache-max-size quite small, then rclone will delete the files as soon as they have been uploaded (after --vfs-cache-poll-interval anyway).