LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-20-2008, 09:08 AM   #1
arbis
LQ Newbie
 
Registered: Oct 2008
Posts: 2

Rep: Reputation: 0
tar archival backups


I'm currently using rsync to sync two directories together for backup purposes. Along with this, I would like to create a tar archive every few days. Running this in a crontab is preferred. How do I create this tar automatically with a new date everytime it is ran? Thanks!
 
Old 10-20-2008, 01:25 PM   #2
shakezilla
Member
 
Registered: Jun 2005
Location: U.S.
Distribution: xubuntu 8.10, linux 2.6.27-11-generic
Posts: 78

Rep: Reputation: 16
Sounds like you know how to use cron, so I guess you're asking how to get date/time info from command line?

man date
 
Old 10-20-2008, 09:24 PM   #3
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Yeah but the trick is how to get a decent filename for tar. This is the command line:
/bin/tar -cf mybackup_$(/bin/date +%Y%m%d).tar /dir_to_backup

The filename part is mybackup_$(/bin/date +%Y%m%d).tar. Check the correct tar syntax, not sure without trying.

jlinkels
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
backups using tar and rsync cucolin@ Linux - Server 2 04-03-2007 12:25 AM
security for backups (tar command) wedgeworth Linux - Software 1 03-18-2004 11:00 AM
tar or cpio - Which is better for tape backups? Br. Nicholas Linux - Software 2 07-02-2003 04:06 PM
Large backups or Tar doesn't work jeanpba Linux - Hardware 1 10-04-2002 10:04 AM
Incremental tar backups Pepe Linux - General 5 03-18-2002 03:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:38 PM.

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