1

I want to run script on remote machine but with delay

for example

 scp -rp script root@$IP:/tmp

 ssh root@$IP:/tmp/script   ( but script will run after 5 sec ) 

the target is to run the script with no connection from source machine ( not via ssh ) , so ssh will be only the trigger and after 5 sec script will run

1

1 Answer 1

1

You can upload a loader script that starts your script after a delay and then run it with the following command to run it remotely:

screen -d -m loader.sh

Loader.sh

#!/bin/bash
sleep 1
script.sh

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .