- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- time difference
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
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
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-21-2008 01:48 AM
тАО04-21-2008 01:48 AM
I've scheduled to export oracle DB everyday at 7AM, by executing the script given below:
#!/usr/local/bin/bash
exportORACLE_HOME=/a1/app/oracle/product/10.1.0
flnm=bkp`date +%a_%H%M`.dat
echo "Exporting Backup to : $flnm on `date +%d/%m/%Y-%H:%M:%S`" >> /home/ora/backup.log
if [ $UID == 255 ]; then
$ORACLE_HOME/bin/exp system/mastermind@ems file=(/a2/ora/1_$flnm,/a2/ora/2_$flnm,/a2/ora/3_$flnm) filesize=4G owner=(nabad,abc_dev) triggers=y compress=y rows=y statistics=none log=/home/ora/logbkp.log1
else
echo "You must logged in as ORACLE user"
fi
echo "====== Backup Completed on `date +%d/%m/%Y-%H:%M:%S` =====" >> /home/ora/backup.log
echo "====== Backup transfer start `date +%d/%m/%Y-%H:%M:%S` =====" >> /home/ora/backup.log
Its running fine.
As I'm running this script at 7AM, the file names generated should be bkpMon_0700.dat but I'm getting a file name of bkpSun_2130.dat
In /var/adm/cron/log, it shows that the script runs at 7Am.
Can anybody help me out?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-21-2008 01:54 AM
тАО04-21-2008 01:54 AM
Re: time difference
There is nothing wrong in the script.The date format also ok.
Please check your system date.
Thanks & Regards
Aashique
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-21-2008 01:56 AM
тАО04-21-2008 01:56 AM
Re: time difference
The time you get is, when the backup has last finished.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-21-2008 02:31 AM
тАО04-21-2008 02:31 AM
Re: time difference
If so, that maybe the difference between 7 AM and 9:30 PM, EDT.
So, you need to export TZ to your correct timezone.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-21-2008 02:48 AM
тАО04-21-2008 02:48 AM
Re: time difference
system date&time is running fine. In the cron log file, exact time is showing. It starts at 7AM & takes 30 to 45 minutes to complete the process.
my time zone is IST-5:30
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-21-2008 02:53 AM
тАО04-21-2008 02:53 AM
Re: time difference
Then you'll have to export it in your cronjob:
export TZ=IST-5:30
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-21-2008 02:54 AM
тАО04-21-2008 02:54 AM
Re: time difference
> The time you get is, when the backup has last finished.
this is not true. The name of the file is generated prior to the execution of the EXP command. So it should be close to the time the script is scheduled for execution.
See above:
flnm=bkp`date +%a_%H%M`.dat
It is definitely related to the timezone settings of the user who has the script scheduled in its crontab.
Please verify as per Dennis post above.
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-21-2008 02:57 AM
тАО04-21-2008 02:57 AM
Re: time difference
Or you can put it in your crontab entry:
00 07 * * * TZ=IST-5:30 backup_script ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-21-2008 03:09 AM
тАО04-21-2008 03:09 AM
Re: time difference
check your users time zone. e.g. root, oracle
from root user
#echo $TZ
from oracle user
#echo $TZ
I guess that earlier in my prfevious post.
If i'm not wrong, from the user you run this script is only using that users date.
BTW, what is findings?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-21-2008 04:46 AM
тАО04-21-2008 04:46 AM
Re: time difference
try with this:
top of the script put your TZ value and then export TZ it.
Thanks & Regards