how can i bring a running job in the foreground?

i startet a wget-job with:

 echo "sh my_wget_script.sh" | at 02:00

the script began to run at 02:00 at night.
i can find the wget-job in the “top” with ID 1234.
i tried to bring the job in the foreground with:

fg 1234

or

fg %1234

but i have no success.
i dont want kill the job.i only want bring the job in the foreground.
How can i do this?

You can’t. It’s not associated with your terminal.

Foreground/background and associated/not associated with terminal are distinct concepts. A foreground process simply means that the shell is waiting for its termination. Normally it would be associated with your current shell terminal, but even that can be detached from by the process. So the two dimensions don’t necessarily have any connection.

If you want to run a job which you may want to check up on later, take a look at the “screen” program which allows you to set up a terminal shell which can be detached from and reattached to at will, even from some other login.

ok, i know screen.
i helped me with:

tail -f /proc/1234/fd/1

Now i can see, what the script do.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Keep in mind that will get you STDOUT but not STDERR, just in case you
want to see things that are not going nto STDOUT (like errors).

Good luck.

jschleede wrote:
> ok, i know screen.
> i helped me with:
>
> Code:
> --------------------
> tail -f /proc/1234/fd/1
> --------------------
>
> Now i can see, what the script do.
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQIcBAEBAgAGBQJKOQD2AAoJEF+XTK08PnB5rF8P/i+Fd2N+37iqYXY49MZf5/r2
aSmqTPbDbALpKybOZcB/aR002x6UlKbb93DEgwXg89wfyhDw0kSBL9SFoh7ODg2F
iRyLg5cbvQR53jzpgaeanJ/Erqar9TZlpCWMRYHdQSfltFsMGSqm7hKtj1IrDeSp
4rtKZ/Xr54s/tf+Vhz7iDruVIjpuEFabatb9hichnrs2IsdT6ynvrCq+DpPcWI93
IMmRaNtqoQSOrdIW1gvrL0s21hQz+OeP7vdE7ERof0/v/HhsvKNZeOytEGDdKTON
GW6/jUYGKe5MyZxdmh6C2ZbLmmHfFFhBmKSOUzC1FmHrrKFotiSUbXb36JIYEzOm
FnGactKzhDvLm2bvKgtvWgxpFVaWs9RiGRg6mYvABbUjacsxP3IdH5u5Sjx2DEsF
uAYh1/klGWmUu6MOHnRkGBHmqFzNiY1kS4usSSTJkEqQLzNXd8ngwDzLLD+Ar0ss
kzLAwtSf1tXhLOCP8DPhtaJjD7S3Eh19Rf4sYHMCqNCBOMxz+dequtQOVOfjJcrq
FbDQ9JLDUynmeOtqIg7M3StPjYllDJTQ8oWi6fMhUpKqWW82PvFkf9tj6xt91qxC
ohb4tG2eDJiO6ubkFQLgg0qn3q4xAVmAohi8AmwzAi29GQeof32cT7r+KK9hMmTD
eITJSS+a6pxSDRXTcj4i
=4ppn
-----END PGP SIGNATURE-----