LinuxQuestions.org
Help answer threads with 0 replies.
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 11-14-2001, 09:17 AM   #1
supafly
LQ Newbie
 
Registered: Jul 2001
Distribution: slackware8
Posts: 5

Rep: Reputation: 0
add timestamp to name of file how?


running a cron job to backup a postgres database with the command

/~/bin/pg_dump mydb > /home/dbuser/mydb.pgsql

but I'd like so that the file name contains a timestamp (or the day of the week, like mydb_friday.pgsql)

how can I do this?

thanks,
k../
 
Old 11-14-2001, 09:52 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
echo arse > made_on_`date +%A`_uh_huh

note the backwards quote marks.
 
Old 11-14-2001, 10:15 AM   #3
supafly
LQ Newbie
 
Registered: Jul 2001
Distribution: slackware8
Posts: 5

Original Poster
Rep: Reputation: 0
thankyou
 
Old 11-14-2001, 11:06 AM   #4
WindozBytes
Member
 
Registered: Aug 2001
Location: CT, USA
Distribution: Mandriva 2008
Posts: 105

Rep: Reputation: 15
Append something like

.$date

to your filename
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Insert date and timestamp Into File name petenyce Linux - Newbie 9 10-13-2005 12:16 PM
Network route add file David@330 Linux - Networking 4 05-26-2005 07:38 AM
How to add data at file beginning in C? Nad0xFF Programming 8 04-17-2005 11:48 AM
Timestamp of file/directories Ephracis Linux - Software 1 12-16-2004 09:21 AM
add a file to... Redrook Linux - Newbie 4 11-10-2003 09:40 PM

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

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