Add license headers

This commit is contained in:
Janek Bevendorff 2014-10-05 01:09:30 +02:00
parent fe1fbf4628
commit c8eb94bd95
11 changed files with 267 additions and 19 deletions

View File

@ -1,12 +1,31 @@
#!/bin/bash #!/bin/bash
## ##
# rs-backup-run # Copyright (C) 2013-2014 Janek Bevendorff
# Copyright (C) 2013-2014 by Janek Bevendorff
# Website: http://www.refining-linux.org/ # Website: http://www.refining-linux.org/
# #
# Script to push backups to a remote rsync backup server. # Script to push backups to a remote rsync backup server.
# Read the source code or use with --help parameter for # Read the source code or use with --help parameter for
# further usage information. # further usage information.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
## ##
@ -21,7 +40,7 @@
# Additional internal config # Additional internal config
############################################################################### ###############################################################################
_VERSION=0.2.0 _VERSION=0.2.1
_GLOBAL_INCLUSION_PATTERN_FILE="/etc/rs-backup/include-files" _GLOBAL_INCLUSION_PATTERN_FILE="/etc/rs-backup/include-files"
_FORCED_INCLUSION_PATTERN_FILE="" _FORCED_INCLUSION_PATTERN_FILE=""
_SKIP_HOME_DIRS=false _SKIP_HOME_DIRS=false

View File

@ -1,6 +1,8 @@
#!/bin/sh #!/bin/sh
## ##
# Copyright (C) 2014 Janek Bevendorff # Copyright (C) 2013-2014 Janek Bevendorff
# Website: http://www.refining-linux.org/
#
# Install script for installing server and client script files # Install script for installing server and client script files
# #
# The MIT License (MIT) # The MIT License (MIT)
@ -35,6 +37,10 @@ if [ $UID -ne 0 ]; then
exit 1 exit 1
fi fi
###############################################################################
# Global variables
###############################################################################
DISTRIBUTION="$(./server/usr/bin/rs-detect-distribution)" DISTRIBUTION="$(./server/usr/bin/rs-detect-distribution)"
COMPONENT="$1" COMPONENT="$1"
MODE="install" MODE="install"
@ -42,12 +48,21 @@ if [[ "$(basename $0)" == "uninstall.sh" ]]; then
MODE="uninstall" MODE="uninstall"
fi fi
###############################################################################
# Command aliases # Command aliases
###############################################################################
CP="cp -vr --preserve=mode,timestamps,links,xattr" CP="cp -vr --preserve=mode,timestamps,links,xattr"
RM="rm -Rvf" RM="rm -Rvf"
MKDIR="mkdir -pv" MKDIR="mkdir -pv"
###############################################################################
# Install mode
###############################################################################
if [[ $MODE == "install" ]]; then if [[ $MODE == "install" ]]; then
# Server component
if [[ $COMPONENT == "all" ]] || [[ $COMPONENT == "server" ]]; then if [[ $COMPONENT == "all" ]] || [[ $COMPONENT == "server" ]]; then
echo "Installing Server component..." echo "Installing Server component..."
@ -147,6 +162,7 @@ if [[ $MODE == "install" ]]; then
echo "Done." echo "Done."
# Client component
elif [[ $COMPONENT == "all" ]] || [[ $COMPONENT == "client" ]]; then elif [[ $COMPONENT == "all" ]] || [[ $COMPONENT == "client" ]]; then
echo "Installing client component..." echo "Installing client component..."
@ -159,6 +175,10 @@ if [[ $MODE == "install" ]]; then
echo "Done." echo "Done."
fi fi
###############################################################################
# Uninstall mode
###############################################################################
elif [[ "$MODE" == "uninstall" ]]; then elif [[ "$MODE" == "uninstall" ]]; then
echo "This will uninstall rs-backup suite from this computer." echo "This will uninstall rs-backup suite from this computer."
echo "Selected components for removal: $COMPONENT" echo "Selected components for removal: $COMPONENT"
@ -172,6 +192,7 @@ elif [[ "$MODE" == "uninstall" ]]; then
exit exit
fi fi
# Server component
if [[ $COMPONENT == "all" ]] || [[ $COMPONENT == "server" ]]; then if [[ $COMPONENT == "all" ]] || [[ $COMPONENT == "server" ]]; then
echo "Uninstalling server component..." echo "Uninstalling server component..."
@ -184,7 +205,8 @@ elif [[ "$MODE" == "uninstall" ]]; then
done done
echo "Done." echo "Done."
# Client component
elif [[ $COMPONENT == "all" ]] || [[ $COMPONENT == "client" ]]; then elif [[ $COMPONENT == "all" ]] || [[ $COMPONENT == "client" ]]; then
echo "Uninstalling client component..." echo "Uninstalling client component..."
@ -206,8 +228,4 @@ elif [[ "$MODE" == "uninstall" ]]; then
echo echo
echo "INFO: Your backup folder was not removed to preserve your data." echo "INFO: Your backup folder was not removed to preserve your data."
echo " If you don't need it anymore, just delete it." echo " If you don't need it anymore, just delete it."
else
# Program should never end here
echo "Nothing to do." >&2
exit 1
fi fi

View File

@ -1,4 +1,30 @@
#!/bin/sh #!/bin/sh
##
# Copyright (C) 2013-2014 Janek Bevendorff
# Website: http://www.refining-linux.org/
#
# Print out Linux distribution identification.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
##
# Check if lsb_release exists # Check if lsb_release exists
command -v lsb_release > /dev/null 2>&1 command -v lsb_release > /dev/null 2>&1

View File

@ -1,4 +1,30 @@
#!/bin/sh #!/bin/sh
##
# Copyright (C) 2013-2014 Janek Bevendorff
# Website: http://www.refining-linux.org/
#
# Rotate backup revisions. Intended for use with cron.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
##
if [ "$1" == "" ]; then if [ "$1" == "" ]; then
echo "Usage: $(basename $0) <rsnapshot config>" echo "Usage: $(basename $0) <rsnapshot config>"

View File

@ -1,4 +1,30 @@
#!/bin/sh #!/bin/sh
##
# Copyright (C) 2013-2014 Janek Bevendorff
# Website: http://www.refining-linux.org/
#
# Run a restricted command in an SSH session.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
##
home_dir=$1 home_dir=$1

View File

@ -1,13 +1,32 @@
#!/bin/sh #!/bin/sh
## ##
# rs-version # Copyright (C) 2013-2014 Janek Bevendorff
# Copyright (C) 2013-2014 by Janek Bevendorff
# Website: http://www.refining-linux.org/ # Website: http://www.refining-linux.org/
# #
# Print out version and copyright information for rs-backup. # Print out version and copyright information for rs-backup.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
## ##
VERSION="0.2.0" VERSION="0.2.1"
echo -e "\e[1mrs-backup-suite\e[0m version ${VERSION}" echo -e "\e[1mrs-backup-suite\e[0m version ${VERSION}"
echo "Copyright (C) 2013-2014 Janek Bevendorff" echo "Copyright (C) 2013-2014 Janek Bevendorff"

View File

@ -1,10 +1,29 @@
#!/bin/sh #!/bin/sh
## ##
# rs-add-ssh-key # Copyright (C) 2013-2014 Janek Bevendorff
# Copyright (C) 2013-2014 by Janek Bevendorff
# Website: http://www.refining-linux.org/ # Website: http://www.refining-linux.org/
# #
# Add SSH key to a backup user for passwordless login # Add SSH key to a backup user for passwordless login
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
## ##
if [ "$1" == "" ] || [ "$2" == "" ] || [ "$3" == "" ]; then if [ "$1" == "" ] || [ "$2" == "" ] || [ "$3" == "" ]; then

View File

@ -1,12 +1,30 @@
#!/bin/sh #!/bin/sh
## ##
# rs-add-user # Copyright (C) 2013-2014 Janek Bevendorff
# Copyright (C) 2013-2014 by Janek Bevendorff
# Website: http://www.refining-linux.org/ # Website: http://www.refining-linux.org/
# #
# Set up a backup user # Set up a backup user.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
## ##
if [ "$1" == "" ] || [ "$2" == "" ]; then if [ "$1" == "" ] || [ "$2" == "" ]; then
. rs-version . rs-version
echo "Usage: $(basename $0) <remote host> <remote username> [<ssh public key file>]" echo "Usage: $(basename $0) <remote host> <remote username> [<ssh public key file>]"

View File

@ -1,5 +1,30 @@
#!/bin/sh #!/bin/sh
##
# Copyright (C) 2013-2014 Janek Bevendorff
# Website: http://www.refining-linux.org/
#
# Create daily, weekly or monthly snapshots from manual push backups # Create daily, weekly or monthly snapshots from manual push backups
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
##
if [ "$1" == "" ]; then if [ "$1" == "" ]; then
. rs-version . rs-version

View File

@ -1,4 +1,30 @@
#!/bin/sh #!/bin/sh
##
# Copyright (C) 2013-2014 Janek Bevendorff
# Website: http://www.refining-linux.org/
#
# Update passwd file in chroot folder based on the contents of /etc/passwd.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
##
. /etc/rs-backup/server-config . /etc/rs-backup/server-config

View File

@ -1,5 +1,31 @@
#!/bin/sh #!/bin/sh
# Check if disk has been used since last check and spin it down if not ##
# Copyright (C) 2013-2014 Janek Bevendorff
# Website: http://www.refining-linux.org/
#
# Utility program. Check if disk has been used since last check and spin it down if not.
# Some distributions such as Synology DSM implement this by themselves.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
##
if [ "${1}" == "" ]; then if [ "${1}" == "" ]; then
echo "Usage: $(basename ${0}) <device file>" echo "Usage: $(basename ${0}) <device file>"