LinuxQuestions.org
Visit Jeremy's Blog.
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 08-11-2008, 10:45 AM   #1
mantonr
LQ Newbie
 
Registered: Apr 2005
Location: England
Distribution: Gentoo
Posts: 20

Rep: Reputation: 0
rsync backup folder naming


I am trying to figure out what command I have to use in order to get rsync to make a backup folder thats name is the current date.

So far I have been trying this:

rsync -avz --backup --backup-dir="/home/robert/Test/'date +%Y-%m-%d'" -e ssh robert@server:/home/robert/Test

That just created a folder called "date +%Y-%m-%d", which isn't quite what I wanted. I literally just want it to say 23/08/2008 or whatever the date is on the day that I do the backup.

Does anyone know how to do this, all the commands I try that I find on the internet lead to similar results as above.
 
Old 08-11-2008, 11:19 AM   #2
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
Code:
rsync -avz --backup --backup-dir="/home/robert/Test/$(date +%Y-%m-%d)" -e ssh robert@server:/home/robert/Test
What you may be seeing on sites is the use of a backtick ` - not a single quote '. As you've discovered the difference is quite important! I've edited your command above with the $() notation, which is a lot less ambiguous.

Last edited by pwc101; 08-11-2008 at 11:23 AM. Reason: formatting
 
Old 08-11-2008, 11:28 AM   #3
mantonr
LQ Newbie
 
Registered: Apr 2005
Location: England
Distribution: Gentoo
Posts: 20

Original Poster
Rep: Reputation: 0
Thanks pwc101 - that worked just fine!
 
  


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
Encrypting backup folder and rsync? toaster.waffle Linux - Security 3 05-31-2008 03:28 AM
Using RSync to backup a secondary off-site backup server pezdspencer Linux - Software 4 06-29-2007 03:40 PM
Using rsync to backup data. Best way to backup folders? Micro420 Linux - General 2 11-23-2006 01:13 AM
Folder Naming Conventions Hitboxx Fedora 4 07-12-2006 08:58 AM
backup folder (rsync) os2 Linux - Software 4 03-29-2006 09:07 PM

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

All times are GMT -5. The time now is 05:41 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