Index →

backup

	Path: /root/bin/backup
	Size: 171 bytes

Create a time-stamped archive of the given directory

Content

#!/bin/sh
TARGET=`basename "$1"`
DATE=`date +"%F-%H.%M"`
echo "$TARGET"-"$DATE".tar.gz
tar -czhvvf "$TARGET"-"$DATE".tar.gz "$1"
echo Output to: "$TARGET"-"$DATE".tar.gz


License

    Copyright (C) 2010 A. Bram Neijt
    This file is part of the logfish.net configuration collection.

    This file is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This file is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You can find a copy of the GNU General Public License
    online at <http://www.gnu.org/licenses/>.