- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Need script to move critical files on the same ser...
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
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
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
07-29-2014 10:27 PM
07-29-2014 10:27 PM
Need script to move critical files on the same server
Hello Experts,
I am having a production server on to which few files are generated on the path /usr/sap/STV/CRDVMGP01/logs.
On that path there are 2 files respectively : report_20140729 & report_20140730...
However i need to move the file for the yesterday to a /dump directory as the size of the file is aprox 25 gig.
Doing that i need to keep todays file as it is on the path , just need to move yesterdays file to dump directory..
Thanks & have a great day ahead...
Vishal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2014 06:54 AM
07-31-2014 06:54 AM
Re: Need script to move critical files on the same server
Are you saying that you need to just move a single file from one directory to another just once? Or do you need to move the file for the previous day every day?
If you just need to move a file once, then just use the mv command.
If you need to move the previous days file every day that is a bit more difficult.
This short script should move the previous days file to the dump directory:
# cat mv_file.sh
#!/usr/bin/sh
YESTERDAY=$(perl -e 'use POSIX;print strftime "%Y%m%d",localtime time-86400;')
cd /usr/sap/STV/CRDVMGP01/logs
mv report_${YESTERDAY} /dump
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2014 09:25 PM
08-03-2014 09:25 PM
Re: Need script to move critical files on the same server
Hello Patric,
Thanks for the reply .
do you need to move the file for the previous day every day? Yes this is what i want...
I will check with the script & get back to you.
Thnaks once again
Have a great day ahead..
Regards
Vishal