- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Move file to file.timestamp
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2003 01:01 AM
04-15-2003 01:01 AM
I am busy writing a script but need help with one command to move one file to another file.ddmmyy (which would automatically show the day script is run date)
Thanks
This is what I got so far , but just can't get the context right.
mv /home/mfgdata/BARCODE.326 /home/mfgdata/BARCODE.`date +'%d%m%y'`
This creates the barcode. file and leaves the extension blank.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2003 01:04 AM
04-15-2003 01:04 AM
Re: Move file to file.timestamp
touch t.$(date +%d%m%y)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2003 01:05 AM
04-15-2003 01:05 AM
Re: Move file to file.timestamp
touch /tmp/BARCODE.$(date +%d%m%y)
ls -la /tmp/ | grep BARCODE*
Try avoiding the ' and `'s
Later,
Bill
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2003 01:07 AM
04-15-2003 01:07 AM
Re: Move file to file.timestamp
touch /tmp/BARCODE..`date +'%d%m%y'`
ls -la /tmp/ | grep BARCODE*
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2003 01:10 AM
04-15-2003 01:10 AM
Re: Move file to file.timestamp
Get first date into a variable:
var=$(date "+%d%m%y%H%M%S")
then rename the file
mv $OLDFILE $NEWFILE.$var
HTH, Vicente.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2003 01:10 AM
04-15-2003 01:10 AM
Re: Move file to file.timestamp
I can't understand your problem.
Your syntax works fine for me ???
#touch FILE.xxx
#mv FILE.xxx FILE.`date +%d%m%y`
#ll FILE.*
-rw-rw-rw- 1 root sys 0 Apr 15 11:05 FILE.150403
Regards,
Fr??d??ric
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2003 01:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2003 01:26 AM
04-15-2003 01:26 AM
Re: Move file to file.timestamp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2003 01:31 AM
04-15-2003 01:31 AM
Re: Move file to file.timestamp
This works perfectly
mv /home/mfgdata/barcode.rud /home/mfgdata/barcode.`date
'+%d%m%y'`
Cheers