I am running crontab as root user:
screen -S konsola -X stuff 'say hello'`echo -ne '\015'`
How do I run it as the user "nobody"? Only this user has screen with given pid, thats why I need it.
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
Can't you just use
crontab -u nobody -e to add your command to nobody's crontab?
Otherwise I would just put this in the root crontab:
su nobody -c "screen -S konsola -X stuff 'say hello'`echo -ne '\015'`"
From the man page:
The su command is used to become another user during a login session. [...] -c, --command COMMAND Specify a command that will be invoked by the shell using its -c.