skip to Main Content

Sorry, I’m newbie to this "linux server" stuff.

so my command is something like this:

while true; do sleep 2; curl -F id="http://YOURDOMAIN" -F scrape=true -F access_token='YOURACCESSTOKEN' -F appID=FACEBOOKAPPID https://graph.facebook.com; done &  

I want it to run infinitely on my ""Centos 8 server"" .

thanx in advance

2

Answers


  1. Add your command to a script say cmd.sh and run it in background.
    nohup sh cmd.sh &
    Here,
    & is for background run and nohup will store all the std out from the script running in the background.

    Login or Signup to reply.
  2. Just use any text editor like vi/vim editor in your centos server to edit. Copy your command and paste into a file say cmd.sh using the editor and then run the nohup sh cmd.sh & command
    If you don’t know about vi editor follow below command

    1. Copy the command
    2. vi cmd.sh
    3. Type "i" to enter insert mode
    4. Click "shift + insert" to paste
    5. Click "esc" key then ":wq"
    6. nohup sh cmd.sh &
      Your std out wil be kn nohup.out file in the same directory
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search