INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

at job

at job

(OP)
Hi


When I run a bash shell manually, it functions well, but when i run it, using at command i have a problem with the "if" cicle.


#!/usr/bin/bash

/usr/tmc/su - ${USER} <<EOF > ${HOME}/traza.log
at -s -m -f ${PathNewDir}${file}.sh ${HORA} ${A_DATEF[1]} ${A_DATEF[2]},${A_DATEF[4]}
atq
EOF


${PathNewDir}${file}.sh

#!/bin/bash

if [[ -s "$file" ]]; then
echo "OK"
then
echo "not found"
fi

Is it possible to get output of the at command when it is executed??
Is it possible to point the output of the at command, to the log file ??

thanks a lot.

malpa



RE: at job

(OP)
Hi PVH


The job is programmed in accordance with the date.
When the job run automatically at the time programmed, the programm always execute the else cicle.


Shell that programm the at job

#!/usr/bin/bash

/usr/tmc/su - ${USER} <<EOF > ${HOME}/traza.log
at -s -m -f ${PathNewDir}${file}.sh ${HORA} ${A_DATEF[1]} ${A_DATEF[2]},${A_DATEF[4]}
atq
EOF


************************************
the output of the traza.log file

commands will be excecuted using /bin/sh
job xxxxxxxxxx.a Day Month Day HH:MM:SS YYYY
************************************

Shell executed by at job,

${PathNewDir}${file}.sh

#!/bin/bash

if [[ -s "${PathNewDir}$file" ]]; then
echo "OK"
else
echo "not found"
fi



when job runs automatically with the at command, always point to the "else" cicle, "not found",.
but if i run it manually, it functions well.


Thanks PVH

RE: at job


When you execute ${PathNewDir}$file.sh with the "at" command, the variables "${PathNewDir}$file" are undefined inside the executed script.
3eyes

----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close