linux - Run a intotify sricpt in background


Question: 

how can i run 12 bash scripts simultaniously in the backgroud?

That's the script:

#/bin/bash

while inotifywait -e close_write /var/www/html/wp-content/QM-Handbuch /01-Inhaltsverzeichnis.doc;

    do       soffice --headless --convert-to pdf /var/www/html/wp-content/QM-Handbuch/01-Inhaltsverzeichnis.doc &&
             sudo mv /var/www/html/wp-content/QM-Handbuch/01-Inhaltsverzeichnis.pdf /var/www/html/wp-content



1 Answer: 

Using the ampersand(&) you can run the bash scripts in background.

Syntax:-

   <prompt> $ bash <file name> &

Example:-

   <prompt> $ bash inotify.sh &
 

More Articles


Shell script - convert Excel (xlsx) to CSV - remove blank space / tab space

I receive excel file (xslx) with multiple sheets for my project. The number of records on these sheets ranges from 15k to 70k per sheet. I need to perform following tasks on this data and then convert it to CSV. Or covert to CSV and then process the data either way its fine.Input Example:call_no un

node.js - Querying multiple sensors regularly using NodeJS

I need to fetch the values of about 200 sensors every 15 seconds or so. To fetch the values I simply need to make an HTTP call with basic authentication and parse the response. The catch is that these sensors might be on slow connection so I need to wait at least 5 seconds for one sensor (but usuall

php - How to redirect everything after slash to domain before?

This is what I'm trying to do:I want example.com/car/{whatever} redirected to example.com/{whatever}. For example, example.com/car/honda should be redirected to example.com/hondaBUT if there is nothing after /car/, then just leave it as that. How can i do that in .htaccess ?


ruby on rails - tmux: are my other terminals still running?

I have started using a certain technique for launching my web code since I switched server setups. I type tmuxsudo startserverrailsCtrl+B then DThen to reboot I type tmuxsudo killall rubysudo startserverrailsCtrl+B then DMy questions are: when I kill the ruby, does that end the session that I starte

node.js - Not able to run my node app at port 80 on ubuntu 16.04

I want to run my node app at port 80 in ubuntu 16.04. But the moment I'm trying to run my app with npm start its throwing error Port in already in use whereas it's not in use. According to Github Reply, We need root privileges to run on ports below 1048 which is correct.So the moment I'm trying to r

mysql - How to install older PHP version in XAMPP on Ubuntu 16.04?

I'm trying to install Magento on my system, But it gives me an error that the PHP version that I have is newer and Magento is not supported that version. So now I'm trying to downgrade my PHP version from XAMPP that I'm installed on Ubuntu 16.04.Error : PHP Version Check Your PHP version is 7.1.1.


c - Printf ubuntu Segmentation fault (core dumped)

I have this code:int a;printf("&a = %u\n",(unsigned)&a);printf("a\n");printf("b\n");printf("c\n");printf("d\n");I tried to print the pointer of a variable.But it fail on the row printf("a\n"); and says Segmentation fault (core dumped)Output:&a = 134525024Segmentation fault (core dumped)W

ubuntu - Docker: bash terminal starts without prompt

I have a simple container that looks like this:FROM devbox/rails3.2.1RUN apt-get install -y -q libmysql-ruby libmysqlclient-devRUN apt-get install -y -q libqtwebkit-devEXPOSE 3000CMD /bin/bashwhere devbox/rails3.2.1 is a container I made that starts with 'FROM ubuntu' and installs Ruby on Rails. Thi

Segmentation fault: Stack allocation in a C program in Ubuntu when bufffer>4M

Here's a small program to a college's task:#include <unistd.h>#ifndef BUFFERSIZE#define BUFFERSIZE 1#endifmain(){ char buffer[BUFFERSIZE]; int i; int j = BUFFERSIZE; i = read(0, buffer, BUFFERSIZE); while (i>0) { write(1, buffer, i); i = read(0, buffer, BUFFE

php - Having trouble with Ubuntu LAMP stack

I have installed Ubuntu 16.04 LTS, Apache2, Mysql 14, Php7. I have installed Drupal with a few difficulties. Specifically, I had to install php extensions and tweak the configs to enable those extensions, and finally the installation was successful. However, whenever I try to click on any link, the