mirror of
https://github.com/uroni/urbackup_backend.git
synced 2025-10-26 11:36:50 +00:00
If a backup was done but failed, wait longer for a retry
This commit is contained in:
parent
556a3b7d4f
commit
00d0b2f357
@ -48,7 +48,8 @@ extern std::string server_identity;
|
||||
const unsigned short serviceport=35623;
|
||||
const unsigned int full_backup_construct_timeout=4*60*60*1000;
|
||||
const unsigned int shadow_copy_timeout=30*60*1000;
|
||||
const unsigned int check_time_intervall=5*60*1000;
|
||||
const unsigned int check_time_intervall_tried_backup=30*60*1000;
|
||||
const unsigned int check_time_intervall=5*60*1000;
|
||||
const unsigned int status_update_intervall=1000;
|
||||
const unsigned int mbr_size=(1024*1024)/2;
|
||||
const size_t minfreespace_image=1000*1024*1024; //1000 MB
|
||||
@ -240,6 +241,7 @@ void BackupServerGet::operator ()(void)
|
||||
}
|
||||
|
||||
bool do_exit_now=false;
|
||||
bool tried_backup=false;
|
||||
|
||||
while(true)
|
||||
{
|
||||
@ -254,6 +256,7 @@ void BackupServerGet::operator ()(void)
|
||||
ServerLogger::Log(clientid, "Getting client settings failed -2", LL_ERROR);
|
||||
}
|
||||
}
|
||||
tried_backup=false;
|
||||
unsigned int ttime=Server->getTimeMS();
|
||||
status.starttime=ttime;
|
||||
has_error=false;
|
||||
@ -383,6 +386,7 @@ void BackupServerGet::operator ()(void)
|
||||
else if(hbu && has_error)
|
||||
{
|
||||
os_remove_nonempty_dir(backuppath);
|
||||
tried_backup=true;
|
||||
}
|
||||
|
||||
status.action_done=false;
|
||||
@ -465,7 +469,11 @@ void BackupServerGet::operator ()(void)
|
||||
}
|
||||
|
||||
std::string msg;
|
||||
pipe->Read(&msg, skip_checking?0:check_time_intervall);
|
||||
if(tried_backup)
|
||||
pipe->Read(&msg, skip_checking?0:check_time_intervall_tried_backup);
|
||||
else
|
||||
pipe->Read(&msg, skip_checking?0:check_time_intervall);
|
||||
|
||||
skip_checking=false;
|
||||
if(msg=="exit")
|
||||
break;
|
||||
@ -780,10 +788,11 @@ bool BackupServerGet::request_filelist_construct(bool full)
|
||||
{
|
||||
CTCPStack tcpstack;
|
||||
|
||||
Server->Log(clientname+L": Connecting for filelist...", LL_DEBUG);
|
||||
IPipe *cc=Server->ConnectStream(inet_ntoa(getClientaddr().sin_addr), serviceport, 10000);
|
||||
if(cc==NULL)
|
||||
{
|
||||
ServerLogger::Log(clientid, L"Connecting to ClientService of \""+clientname+L"\" failed - CONNECT error", LL_ERROR);
|
||||
ServerLogger::Log(clientid, L"Connecting to ClientService of \""+clientname+L"\" failed - CONNECT error during filelist construction", LL_ERROR);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -792,6 +801,7 @@ bool BackupServerGet::request_filelist_construct(bool full)
|
||||
else
|
||||
tcpstack.Send(cc, server_identity+"START BACKUP");
|
||||
|
||||
Server->Log(clientname+L": Waiting for filelist", LL_DEBUG);
|
||||
std::string ret;
|
||||
unsigned int starttime=Server->getTimeMS();
|
||||
while(Server->getTimeMS()-starttime<=full_backup_construct_timeout)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user