LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-13-2007, 09:36 PM   #1
glenn69
Member
 
Registered: Jul 2003
Location: Chicagoland
Distribution: ArchLinux
Posts: 261

Rep: Reputation: 32
How to backup /home except hidden/system files


I would like to run an automatic backup via cron for my data files in /home/~

I do not wish to copy everything in my /home/~ as there are hundreds of hidden files that I am not too concerned about. I simply want to backup my data files.

How do I limit the backup to data only files without having to list each directory separately?

Thanks
 
Old 05-13-2007, 10:40 PM   #2
Buto
Member
 
Registered: Sep 2004
Location: So Cal
Distribution: Slackware 12
Posts: 60

Rep: Reputation: 16
I use rsync to backup my files in a script that gets run by cron every night. Use the --exclude ".*" option.

Hope this helps.
 
Old 05-14-2007, 07:50 AM   #3
glenn69
Member
 
Registered: Jul 2003
Location: Chicagoland
Distribution: ArchLinux
Posts: 261

Original Poster
Rep: Reputation: 32
That sounds like what i am looking for, would you be willing to share that script so that I could have a starting place.
 
Old 05-16-2007, 09:46 AM   #4
Buto
Member
 
Registered: Sep 2004
Location: So Cal
Distribution: Slackware 12
Posts: 60

Rep: Reputation: 16
Sorry for the late response. But here is the script I created.

Code:
#!/bin/bash

LOG=/path/to/log/file
BACK_FOLD=/path/to/backup/folder

echo "** Start Backup: $(date +'%m.%d.%Y %H:%M:%S') **" >> $LOG

# <--------------- Backup Start -------------->

##############  Pictures Backup ##################

ORIG_PICS="/path/to/Pictures"

echo ' ' >> $LOG
echo "Pictures Backup Start: $(date +'%H:%M:%S')" >> $LOG 
rsync -ruvt $ORIG_PICS $BACK_FOLD >> $LOG 2>&1


##############  MUSIC Backup ##################

ORIG_MUSIC="/path/to/music"

echo ' ' >> $LOG
echo "Music Backup Start: $(date +'%H:%M:%S')" >> $LOG 
rsync -ruvt $ORIG_MUSIC $BACK_FOLD >> $LOG 2>&1


##############  Drivers Backup ##################

ORIG_DRIVERS="/mnt/public/Drivers"

echo ' ' >> $LOG
echo "Drivers Backup Start: $(date +'%H:%M:%S')" >> $LOG 
rsync -ruvt $ORIG_DRIVERS $BACK_FOLD >> $LOG 2>&1


##############  Home Backup ##################

ORIG_HOME="/home/username"

echo ' ' >> $LOG
echo "Username Backup Start: $(date +'%H:%M:%S')" >> $LOG 
rsync -ruvt $ORIG_JOHN $BACK_FOLD >> $LOG 2>&1

# <--------------- Backup End -------------->

# <---------------Start Permissions ------------>
echo ' ' >> $LOG
echo 'Changing Owner' >> $LOG
chown root:root -Rv $BACK_FOLD >> $LOG 2>&1
echo ' ' >> $LOG
echo 'Changing Permissions' >> $LOG
chmod 700 -Rv $BACK_FOLD >> $LOG 2>&1

echo ' ' >> $LOG
echo "** Backup Stopped: $(date +'%H:%M:%S') **" >> $LOG
echo ' ' >> $LOG
echo ' ' >> $LOG
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
recursive backup of hidden files cp -a /home/user1/,* goes up the tree Emmanuel_uk Linux - Newbie 5 02-25-2006 04:42 AM
home directory files gone, hidden files remain Grasshopper Linux - Security 12 04-10-2005 08:23 PM
Hundreds of hidden files in home directory doobers Linux - Newbie 3 02-14-2005 02:57 PM
hmm.. hidden system files need some help glacier1985 Linux - Newbie 5 06-07-2004 09:20 PM
Cleaning Home hidden files melinda_sayang Linux - General 4 02-23-2004 02:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration