Checking the existance of destination directory
Re: Checking the existance of destination directory
The problem is that sometimes the destination is not available at the start, but it is mounted as a pre-backup event, so if the existence is checked before then such backups will not be possible.
--
Luis Cobian
Cobian Backup's creator
Luis Cobian
Cobian Backup's creator
Re: Checking the existance of destination directory
You might be able to create a batch file with a line like this:
if not exist c:\lists.txt exit 7
and then don't continue backup on error be checking "Cancel the task if some event fails."
if not exist c:\lists.txt exit 7
and then don't continue backup on error be checking "Cancel the task if some event fails."
Re: Checking the existance of destination directory
You need to return a non zero value in your script in order for the task to be aborted.
--
Luis Cobian
Cobian Backup's creator
Luis Cobian
Cobian Backup's creator
Re: Checking the existance of destination directory
I thought that's what my example does, return 7 when the file is missing.
Re: Checking the existance of destination directory
But do you have options/ Engine/Anlalyze exit code for "Execute and wait" events checked?
--
Luis Cobian
Cobian Backup's creator
Luis Cobian
Cobian Backup's creator
Re: Checking the existance of destination directory
Sorry, I know how to do this, I was trying to help the poster and I pointed out that needed to be checked.
Re: Checking the existance of destination directory
Hi, first of all I'd like to thank you for a excelent job with Cobian Reflector.
I have the same problem, but for different reason.
Namely, my local Home NAS is not avilable when I'm on VPN. And it's almost impossible for me to fix this on network, becouse I actualy use 3 different VPN-s for different servers.
So, in case of beeing on VPN, Cobian creates local zip file, then clears Archive flag and then tries to copy zip to NAS, but fails. And deletes zip afterwards. Or, in case of full backup, it creates full backups zip, marks (somehow) that full backup has been created and then tries to copy it... with the same result.
This actualy resulted in me loosing some files, becouse I had 3 increments of a folder, but no (new) full backup of it.
My suggestion would be just to change the order of operations. In case of full backup:
I have the same problem, but for different reason.
Namely, my local Home NAS is not avilable when I'm on VPN. And it's almost impossible for me to fix this on network, becouse I actualy use 3 different VPN-s for different servers.
So, in case of beeing on VPN, Cobian creates local zip file, then clears Archive flag and then tries to copy zip to NAS, but fails. And deletes zip afterwards. Or, in case of full backup, it creates full backups zip, marks (somehow) that full backup has been created and then tries to copy it... with the same result.
This actualy resulted in me loosing some files, becouse I had 3 increments of a folder, but no (new) full backup of it.
My suggestion would be just to change the order of operations. In case of full backup:
- create zip
- try top copy file to destination
- delete zip
- if copy sucessful: mark that full backup has been created
- create zip
- try top copy...
- delete zip
- if copy sucessful: delete achive flag on files
- If full backup is unsucessful, Cobian will retry create full backup at nbext occasion (next day)
- if incremental backup is unsucessful, Cobian will include changes in next day increment
Re: Checking the existance of destination directory
--
Luis Cobian
Cobian Backup's creator
Luis Cobian
Cobian Backup's creator
Re: Checking the existance of destination directory
Thanks ira. You helped me a lot
If anyone wonders:
Create a file on your network folder (for example \\NAS\NAS.txt)
Create a text file on your computer containing this:
Code: Select all
@echo off
if exist \\NAS\NAS.txt (
exit 0
)
else (
exit 7
)
Right click this file and create a shortcut. Right click the shortcut and change the Run parameter to "Minimazed".
In Cobian Tools-Options-Engine check "Analyze exit code..."
In backup task options Events add "Execute and wait" and choose your "check_NAS.bat.Ink" file.
In the same window check "Cancel the task if some event fails".
You can skip the shortcut creation and execute directly the BAT file but the cmd window can be visible for a few seconds everytime the task starts.
This works for me. Sorry for being a bit primitive. Not everyone is a programmer.