 |
| Categories Menu |  | |
| Navigation |  |
|
|
Home |
| |
|
|
Community |
| |
|
Content |
| |
|
Support Us |
| | | | |
| |
| User Info |  |
| Welcome, Anonymous
Membership:
 Latest: hiobgiou
 New Today: 0
 New Yesterday: 0
 Overall: 225
People Online:
 Visitors: 4
 Members: 0
 Total: 4
| | |
| |
| hacker Beware |  | |
 | |
Tips: Backup Script
Posted on Friday, September 17 @ 12:39:18 CDT by maysvill
|
Anonymous writes "Hi! I found this backup script on the web a while ago, and thought your users might like it. Should be commented enough to figure out what needs changed.
#!/bin/bash
## make sure you change this to suit your username and group names,
## plus backup locations and files to back up
date="`date +%Y-%m-%d`"
olddate="`date --date '5 months ago' +%Y-%m`"
# Zip, Create, one fiLesystem, absolute Paths, File:
## list all directories to be backed up here and location to back them up to
tar -zclPf "/backup/sysconfig-$date.tar.gz" /etc
tar -zclPf "/backup/www-$date.tar.gz" /data/www
tar -zclPf "/backup/username-$date.tar.gz" /home/username
# set permissions of backup files
chmod 600 /backup/*
## change username:usergroup to correct name:group
chown username:usergroup "/backup/username-$date.tar.gz"
# Remove all backups created 5 months ago (find -ctime could be used instead)
rm -f /backup/sysconfig-$olddate-*.tar.gz
rm -f /backup/www-$olddate-*.tar.gz
rm -f /backup/username-$olddate-*.tar.gz
# mail a message with the mail tool from the 'mail' package.
echo "Info: new backup created on `date` ($date)". | mail -s "backup created" username@localhost
Note: submitted by anonymous user, therefore I have no idea who to give credit to this script."
|
| |
| Related Links |  | |
| Article Rating |  | |
| Options |  | | |
Associated Topics
  |
|
|
| | The comments are owned by the poster. We aren't responsible for their content. |
|
|
|
No Comments Allowed for Anonymous, please register |
|
|
|