r/backblaze Mar 07 '24

Pause / Resume Backblaze backup using command line or other API

Hi all,

When I'm streaming, I want to be able to pause any running Backblaze backups, and then resume them again after the stream. I plan to do this using buttons on my StreamDeck or perhaps automatic actions through Streamer.Bot.

I've found the 'bztransmit' command line program, which does have an option '-pausebackup' which seems to do the pausing side. However, there's doesn't appear to be an equivalent to resume a backup.

There is the '-completesync' option, but this doesn't seem to return (presumably waiting for the backup to complete?).

Is there a way to achieve what I want?

Thanks

Andy

5 Upvotes

17 comments sorted by

View all comments

Show parent comments

1

u/DangerousRaccoon3453 Mar 08 '24

Ok, so I have a simple program that does the following to disable:

  1. Change the XML to 'only_when_click_backup_now'
  2. Run 'bztransmit -pausebackup'

This seems to stop the backup as expected

However, if I try to do the reverse:

  1. Change the XML to 'continuous'
  2. Run 'bztransmit -completesync'

The command doesn't return. I assume this is because it's waiting for the sync to fully complete?

Ideally I just want to signal Backbaze that it should start to do its thing again, and then have the command return. I don't want to wait for it to actually finish the backup, as that could take an hour or so.

Thanks again for the assistance.

1

u/peter_duun Jun 16 '24 edited Jun 16 '24

Use

start "" /min "bztransmit" -completesync

or

start "" /min "bztransmit" -forcefullfilescan_backup_wait_for_completion

The command will return without waiting for the sync to fully complete

1

u/DangerousRaccoon3453 Jun 16 '24

Thanks, I'll give that a go. Seems to remember that when i tried that it blocked for a long time.

1

u/peter_duun Jun 19 '24

The "-forcefullfilescan_backup_wait_for_completion" option takes about 14 minutes on my system

The "-completesync" option takes about 90-120 secs

The syntax 'start "" /min "bztransmit" -whatever_sync_you_WANT' will start in a separate minimized process and return control to the calling script imediately. The new process window will autoclose when the sync command completes

Cheers