Avamar: How to Use the Screen Program for Long-running Tasks

Summary: This article outlines the steps for using the screen utility to carry out tasks that SSH session timeouts may disrupt. By following these instructions, you can ensure that lengthy processes continue to run uninterrupted. ...

This article applies to This article does not apply to This article is not tied to any specific product. Not all product versions are identified in this article.

Instructions

What is a screen in Linux?
Screen serves as a comprehensive window manager that enables multiple processes, interactive shells, to share a single physical terminal screen.

Its key advantage lies in its ability to detach processes, meaning that even if the initiating SSH session ends, the processes within the screen remain unaffected. This feature is useful for running long-running tasks without the danger of them being cut off due to SSH timeouts specified in the /etc/ssh/sshd_config file.

Unlike running a process in the background with nohup, a screen provides the capability to interact with the process. This is essential in situations where input is required from the user, which would not be feasible with nohup.

For example, using nohup would not be possible in the following scenario, because the script expects the input:
admin@ave-1:~/>: remove_ddr_backups --delete-backups ddrindex 1
remove_ddr_backups will irrevocably destroy backup data on server 'ave-1'.
Type 'yes' to permanently remove backup data on this server:
How to use screen in Avamar.
There are multiple ways of using screen. Below is an example of how the utility should be used in Avamar.
The -S option should be used to specify the screen name. The best practice would be to use the Service Request number so that the session can be identified.

Example:
screen -S SR19150xxxx
This command opens the new screen session with the session name of SR19150xxxx with the command prompt.
 
Note: The <PID.session_name> identifies the screen sessions, not just the session name alone. Because of that, the same session name can be used multiple times. If the session name is used multiple times, the screen -ls command lists all of them:
 
admin@ave-1:~/>: screen -ls
There are screens on:
        925.SR19150xxxx (Attached)
        759.SR19150xxxx (Detached)
2 Sockets in /var/run/uscreens/S-admin.

Note: The screen sessions inherit the privileges of the user that created a session. If the session is created as an admin user, it presents the admin user’s prompt upon creation. The sessions are isolated, and users cannot see the sessions created by other users - that is also true for the root user!

Within a screen session, run the command as if this was a standard SSH session. When the command is running, it is possible to leave the screen session using the key combination of Ctrl+AD, if required. If the session is left open, it remains open until it is terminated, even when the connection to the Avamar node times out.

If the process came back to the command prompt and the intent is to leave the screen session running (not recommended), detach the current screen using:
screen -d
How to list the running sessions.
The below commands can be used to list current sessions on the system:
screen -ls
or
screen -list
 
Note: The commands only list the screen sessions for the current user. For example, running the command as the root user does not show sessions started by the admin user.

How to re-connect to the running session.
The following command is used to re-connect to the session:
screen -r <session_name>
Example:
admin@ave-1:~/>: screen -ls
There is a screen on:
        8349.SR19150xxxx        (Detached)
1 Socket in /var/run/uscreens/S-admin.

admin@ave-1:~/>: screen -r 8349.SR19150xxxx

How to terminate the screen session.
From within the screen:
exit
From outside of the screen:
screen -X <session_name> kill

Additional Information

For more information about the screen utility, check the Linux Manual This hyperlink is taking you to a website outside of Dell Technologies.

Affected Products

Avamar Server

Products

SUSE Linux Enterprise Server 12, SUSE Linux Enterprise Server 15
Article Properties
Article Number: 000227271
Article Type: How To
Last Modified: 19 June 2025
Version:  4
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.