VPSNext


Go Back   Your VPSNext Community > Programming / Other > General Linux

General Linux Are you a Linux fan or just a guru. Talk about Linux and all of the ideas you may have about it here. We’re all looking for more knowledge about the world's best open source operating system, so let's share your happy times and bad times here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-08-2010, 05:49 PM
jimlongo jimlongo is offline
Junior Member
 
Join Date: Apr 2010
Location: t-dot
Posts: 9
Question Cron question

I have a cron job that I use to backup the folder of a domain . . . it goes something like this
cd /home; tar -czvf ../_BACKUP/bu_RDIV.tar.gz rdiv

this would create a file called bu_RDIV.tar.gz in the home/_BACKUP folder of the contents of the folder rdiv.

Now I have another domain/folder called jim that I want to backup - this folder contains a folder called media that is much too large for me to want to backup with a cron job. It never changes and I already have a backup locally. Is there a way to modify this scrip so that i backup the contents of the folder jim except for the folder media ?

THanks,
jim
Reply With Quote
  #2  
Old 05-10-2010, 12:24 AM
jimlongo jimlongo is offline
Junior Member
 
Join Date: Apr 2010
Location: t-dot
Posts: 9
Default Re: Cron question

In case it helps someone else, I found a solution in the man pages for tar
Quote:
--exclude pattern
Do not process files or directories that match the specified pattern. Note
that exclusions take precedence over patterns or filenames specified on the
command line.

so something like this will copy the entire contents of the public_html folder except for the media folder to a file called backupFile.tar.gz

cd /home/accountname; tar -czvf backupFile.tar.gz --exclude media public_html
Reply With Quote
Reply

Tags
cron

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On

Forum Jump


All times are GMT -4. The time now is 03:13 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.

Copyright 2008 VPSNext. All rights reserved.