LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
LinkBack Search this Thread
Old 03-02-2005, 08:07 PM   #1
auden
LQ Newbie
 
Registered: Feb 2005
Posts: 2

Rep: Reputation: 0
Help! tar file's name is truncated


Hi,

I am currently running a script in crontab. The script would take the files from a certain folder and tar them according to the date and system time but the output filename i get from the tar file is incomplete.

Eg. `date +'A%Y%M%e%k%M%SA'`.tar *.log
my output would be A200503021 and there would be an error 24523A.tar: No file or directory found.

Assuming the time is 12:45:23

How do i solve this problem?
Thanks

p.s. I dont think its the filename length problem as, if i remove the %Y my output would be A03021
 
Old 03-02-2005, 09:09 PM   #2
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
Why the '%e'? That's putting a space in instead of a zero, so
date +%A%Y%M%d%k%M%SA
would work. Or you can try double-quoting the date string
"`date +'A%Y%M%e%k%M%SA'`"

-- Oh, and to clarify, it's not be 'truncated', exactly - it's just being treated as two filenames because of the whitespace separator.

Last edited by slakmagik; 03-02-2005 at 09:10 PM.
 
  


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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i decompress this tar.tar file? hmmm sounds new.. tar.tar.. help ;) kublador Linux - Software 10 02-23-2008 05:40 AM
Truncated IP??? What? slaken Linux - Networking 5 05-12-2004 03:51 AM
file's extension??? amanjsingh Linux - Newbie 2 04-17-2004 09:22 AM
Truncated 'last' output, please help! Hackeron Linux - General 1 01-04-2004 08:34 AM
Output truncated when using pipe tells Linux - General 1 12-16-2003 08:06 PM


All times are GMT -5. The time now is 12:26 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration