- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: understanding command
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
тАО10-29-2010 08:24 AM
тАО10-29-2010 08:24 AM
15 2 * * 5 /usr/sam/lbin/br_backup LTO FULL Y /dev/rmt/0m /var/sam/graphRCAa16294 root Y 1 N > /var/sam/SAM_br_msgs 2>&1 #sambackup
I understand crons and I understand this executes our backup and I get an email from the system. I need help understanding this part...
> /var/sam/SAM_br_msgs 2>&1 #sambackup
I cannot find any files on my system named "SAM_br_msgs" and sambackup. I do not understand what 2>&1 means.
So if anyone is willing to shed some light on this, I surely will be appreciative.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-29-2010 08:39 AM
тАО10-29-2010 08:39 AM
Re: understanding command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-29-2010 08:45 AM
тАО10-29-2010 08:45 AM
Re: understanding command
The '#sambackup' is just a comment. No need to worry about that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-29-2010 09:19 AM
тАО10-29-2010 09:19 AM
SolutionEach command you run will normally have three standard file descriptors, connected to standard input/output streams. Usually these streams are connected to your terminal, but you have the option of redirecting them to something else.
The first of these standard streams is the standard input stream, or stdin for short. It is associated with file descriptor 0. Its usual role is passing the data you type from the terminal to the program.
The second standard stream is the standard output stream, or stdout. It is associated with file descriptor 1. Its usual role is passing the output of the program to the terminal.
The third standard stream is the standard error output, or stderr. It is associated with file descriptor 2. It is distinct from the standard output, so that you can still see any error messages on your terminal if you redirect the regular output stream somewhere else. Or you can redirect the regular output to one place and errors to another.
The standard input and output are redirected using the redirection operators <, > and >>. The standard error output can be redirected using "2>" or "2>>".
You can also refer to the standard input and output streams using the full form of the redirection operators, like 0< or 1>, but the short forms are overwhelmingly more common with these streams.
"> /var/sam/SAM_br_msgs" (with or without the space) means "redirect the standard output of this command to file /var/sam/SAM_br_msgs. Any existing data in the file will be overwritten when the command is executed, even if it does not produce any output. If the file does not exist, it will be created.
"2>&1" means "redirect the standard error output to file descriptor 1", i.e. "send the program's error messages to the same place as the standard output goes". As the standard output was redirected to file /var/sam/SAM_br_msgs, any error messages produced by the br_backup command will end up there too.
Since "/var/sam/SAM_br_msgs" begins with the "/" character, this is a fully-qualified path name: it unambiguously identifies where the file should be. If the file does not exist, perhaps some other cron job deletes it?
Or perhaps there is something wrong with the command line, and it cannot be executed? The cron daemon will normally send email to the owner of the job only if the job produces any output that is not redirected elsewhere, or if the command returns with an error code. As all the output of this command (including error messages) should go to /var/sam/SAM_br_msgs, there should be no output going to the mail message at all.
The part "#sambackup" is just a comment: anything after the # character will have no effect, and can be used to describe the purpose of the command line. In this case, it probably indicates this command line was produced using SAM.
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-29-2010 11:05 AM
тАО10-29-2010 11:05 AM
Re: understanding command
I find it much more reliable to make a cron command file somewhere, and run that.
Your file(my_backup, for example) would contain:
/usr/sam/lbin/br_backup LTO FULL Y /dev/rmt/0m /var/sam/graphRCAa16294 root Y 1 N > /var/sam/SAM_br_msgs 2>&1
And your cron command would be:
15 2 * * 5 /home/admin/croncmds/my_backup >/dev/null 2>&1
Of course, you can move that "my_backup" command anywhere you'd like, you get the picture...
I just find that my stuff runs more reliably and happily from cron if I make a command file out of it. Much fewer problems that way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-29-2010 12:01 PM
тАО10-29-2010 12:01 PM
Re: understanding command
Thanks for shedding light on this. My sysadmin guy is not here any more and I'm it for now.
- Joy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-29-2010 05:05 PM
тАО10-29-2010 05:05 PM
Re: understanding command
What does it show?
Does /var/sam/ exist?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-29-2010 07:34 PM
тАО10-29-2010 07:34 PM
Re: understanding command
Have you tried running the job on the command line to see if the file is created ?
This will eliminate "cron" from the equation. If it still isnt there then the problem may well be in your br_backup (or your options). I take it its a SAP / Oracle backup ? or is it just named "br*" ?.
My suggestions would be:
1. Run full command as is on the command line;
2. if no "joy", then the problem would be in the br_backup or the options used;
3. try running the command without the re-direction part ie "/usr/sam/lbin/br_backup LTO FULL Y /dev/rmt/0m /var/sam/graphRCAa16294 root Y 1 N" - if theres no output, then theres definitely an issue with the backup or lack thereof.
4. Check the permissions of /var/sam and make sure its writeable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-01-2010 04:02 AM
тАО11-01-2010 04:02 AM
Re: understanding command
Full backup started on roa6 : Fri Oct 29 05:00:00 EDT 2010 (Scheduled Backup)
{ fbackup -0 -u -g /var/sam/graphFGAa04508 -I /var/sam/log/br_index.full -c /etc/sam/br/fbackup_config -d /var/adm/fbackupfiles/dates -f /dev/rmt/1m } 2>&1
Full backup completed successfully on roa6 : Fri Oct 29 05:52:48 EDT 2010 .
Exit code = 0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-01-2010 04:12 AM
тАО11-01-2010 04:12 AM
Re: understanding command
Perhaps br_backup automatically sends its log info to br_log. If br_backup is a script, you can search for br_log.