Callback Script for Back In Time


/ Published in: Bash
Save to your folder(s)

There is a user-callback example in http://bazaar.launchpad.net/~bit-team/backintime/user-callback/view/head:/user-callback.apt-backup which will backup all package selections, sources and repository keys which are necessary to reinstall exactly the same packages again. It will even backup whether a package was installed manually or automatically because of dependencies.

Download the script, copy it to '~/.config/backintime/user-callback' and make it executable with 'chmod 755 ~/.config/backintime/user-callback'

It will run every time a new snapshot is taken. Make sure to include '~/.apt-backup'


Copy this code and paste it in your HTML
  1. #!/bin/sh
  2. # Copyright (c) 2012-2014 Germar Reitze
  3. #
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 2 of the License, or
  7. # (at your option) any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License along
  15. # with this program; if not, write to the Free Software Foundation, Inc.,
  16. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  17.  
  18. # backup selection of apt-get
  19. # Take a look at
  20. # https://answers.launchpad.net/backintime/+faq/2455
  21. # https://answers.launchpad.net/backintime/+faq/2456
  22.  
  23. profile_id="$1"
  24. profile_name="$2"
  25. reason="$3"
  26. errorcode="$4"
  27. DST="$HOME/.apt-backup"
  28.  
  29. case $reason in
  30. 1) #on process begin
  31. mkdir -p $DST
  32. dpkg --get-selections > $DST/package.list
  33. apt-mark showauto > $DST/pgk_auto.list
  34. apt-mark showmanual > $DST/pgk_manual.list
  35. rm -f $DST/sources.list.d/*
  36. cp -aR /etc/apt/sources.list* $DST/
  37. apt-key exportall > $DST/repo.keys
  38. ;;
  39. esac

URL: https://bazaar.launchpad.net/~bit-team/backintime/user-callback/view/head:/user-callback.apt-backup

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.