Koozali.org: home of the SME Server

Using BackupPC in a script via command ssh

Offline Arnaud

  • *
  • 143
  • +0/-0
    • GuedeL
Using BackupPC in a script via command ssh
« on: April 23, 2015, 09:40:12 PM »
Good evening,

the target is to backup the SME on a client machine with a script startet from the sme.
BackupPC is installed on the client (Fedora) and is able to backup the SME (signal-event pre-backup and signal-event post-backup included).

The "problem" is that this client machine is not running 24/24.
Therefore I would like that the SME is able to WOL this client (works well), ask the client having BackupPC via a ssh command to start the backup and shutdown the client after the backup done.

--> is it possible to "force" BackupPC to start a backup from the command line??
If "yes" please be so kind to give me the command...............

At this time, I run an other method: the sme WOL the client at 6am and BackupPC on the client is configured to start by 6:15am.
This work, the backup is done.

But the problem is to shutdown the client after this:
- I tried a "shutdown -h now" in the post-script but it doesn't work because the client is switched off before the script sends positiv result to BackupPC
- I tried that the post-script only starts a "shuting-down" script and get the prompt back wit the "&":
Code: [Select]
./the_shutdown_script &But it doesn't work, even if the shutdown-script starts by waiting 10 minutes: in the logs, I see that BackupPC continues to wait that the shutdown-script is done before closing the backup.

--> how can I shutdown the client after the backup is over??
or how can I make BackupPC only starts the shutdown-script but without waiting it's done, before closing the backup?

Thanks.
Arnaud

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: Using BackupPC in a script via command ssh
« Reply #1 on: April 23, 2015, 10:37:28 PM »
you don't need it

backuppc runs a network scan every hour (you can adapt it at your needs).. so, for example, let SME wake up che client at 01:55 AM and backup will run at 02:00

Offline Arnaud

  • *
  • 143
  • +0/-0
    • GuedeL
Re: Using BackupPC in a script via command ssh
« Reply #2 on: April 24, 2015, 04:41:33 PM »
Hi Stefano,
thanks you for your reply.
What you describe is the way I do currently to start the backup.

The problem stays to switch off the client after it has done the backup.

Bye
Arnaud