Title: Ubuntu command ln -fs
Tags: ruby;bash;shell;ubuntu;nginx
Question: on a mina-deploy script after install monit the script create a link with the monitored services like nginx etc.
but before finish the install show this error,
someone know what is
ln -fs
command on shell?
```
-----&gt; Setting up Monit...
-----&gt; Put monit/nginx.erb file to /shared/config/monit/nginx bash: line 82: /shared/config/monit/nginx: Is a directory $ sudo ln -fs  &quot;/shared/config/monit/nginx&quot; &quot;/&quot;
-----&gt;   FAILED
```
the rest of the script
```namespace :monit do

  desc &quot;Install Monit&quot;
  task :install do
    invoke :sudo
    queue %{echo &quot;-----&gt; Installing Monit...&quot;}
    queue &quot;sudo apt-get -y install monit&quot;
  end

  desc &quot;Setup all Monit configuration&quot;
  task :setup do
    invoke :sudo
    if monitored.any?
      queue %{echo &quot;-----&gt; Setting up Monit...&quot;}
      monitored.each do |daemon|
        invoke :&quot;monit:#{daemon}&quot;
      end
      invoke :'monit:syntax'
      invoke :'monit:restart'
    else
      queue %{echo &quot;-----&gt; Skiping monit - nothing is set for monitoring...&quot;}
    end
  end


  task(:nginx) { monit_config &quot;nginx&quot; }
  task(:postgresql) { monit_config &quot;postgresql&quot; }
  task(:redis) { monit_config &quot;redis&quot; }
  task(:memcached) { monit_config &quot;memcached&quot; }
  task(:private_pub) { monit_config &quot;private_pub&quot;, &quot;#{private_pub_name}&quot; }

  %w[start stop restart syntax reload].each do |command|
    desc &quot;Run Monit #{command} script&quot;
    task command do
      invoke :sudo
      queue %{echo &quot;-----&gt; Monit #{command}&quot;}
      queue &quot;sudo service monit #{command}&quot;
    end
  end
end
```



Here is another answer: man-page for ```ln``` would be a good start.

```ln -fs [TARGET] [DIRECTORY]
```

Makes symbolic link between files. ```-f``` will "force" the link to be updated, if already exists.

Given the wording in your error message, I'm guessing ```/shared/config/monit/nginx``` doesn't exist, which is why the ```ln``` command fails.


{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2017:00:02/01/17', 'FavoriteCount': 1.0, 'PostTypeId': 1, 'Tags': '<ruby><bash><shell><ubuntu><nginx>', 'Title': 'Ubuntu command ln -fs', 'ViewCount': 31495, 'id': 41970263, 'user_AboutMe': None, 'user_AccountId': 10142251.0, 'user_DisplayName': 'japoowf', 'user_Reputation': 49.0, 'user_Views': 5.0, 'user_id': 7491598.0}}