Hi

You had previous requested examples how parallel is being used.

I have a mysql server which has 20 databases. All of them has been
dumped into 20 files and I want to reload them on a new server.

The raw file size is 20GB and it will take about 5 hours to load them.
I tried that but saw in htop that only 2 cores out of 32 was running.

Obviously a job for parallel. I tried this one:
   parallel 'mysql {.} < {}' ::: *.sql
(also with 'time' at the start of the line to see how long it took)

The name of the files are identically to the name of the database. So
'{}' is the file 'foo.sql' and '{.}' is the database 'foo'.

It took less than an hour when using parallel.


/hans

Reply via email to