首页 \ 问答 \ 如何使用Linux bash函数“并行触发两个进程”(How to use a Linux bash function to “trigger two processes in parallel”)

如何使用Linux bash函数“并行触发两个进程”(How to use a Linux bash function to “trigger two processes in parallel”)

请考虑以下示例代码段:

function cogstart
{
    nohup /home/michael/..../cogconfig.sh
    nohup /home/michael/..../freshness_watch.sh
    watch -n 15 -d 'tail -n 1 /home/michael/nohup.out'
}

基本上,fresh_watch.sh和最后的watch命令应该并行执行,即watch命令不必等到它的前传完成。 我想尝试使用xterm,但由于fresh_watch.sh是一个最多可持续15分钟的脚本(由于我在Linux中编写文件监视脚本的不良方式),我当然希望触发此脚本仍在执行时的最后一个监视命令...

有什么想法吗? 也许在两个独立/独立的终端?

非常感谢任何提示/帮助。


Please kindly consider the following sample code snippet:

function cogstart
{
    nohup /home/michael/..../cogconfig.sh
    nohup /home/michael/..../freshness_watch.sh
    watch -n 15 -d 'tail -n 1 /home/michael/nohup.out'
}

Basically the freshness_watch.sh and the last watch commands are supposed to be executed in parallel, i.e., the watch command doesn't have to wait till its prequel to finish. I am trying to work out a way like using xterm but since the freshness_watch.sh is a script that would last 15 minutes at the most(due to my bad way of writing a file monitoring script in Linux), I definitely want to trigger the last watch command while this script is still executing...

Any thoughts? Maybe in two separate/independent terminals?

Many thanks in advance for any hint/help.


原文:https://stackoverflow.com/questions/5190450
更新时间:2024-02-22 21:02

最满意答案

您看到的代码是将要导出的.sql文件的内容。 它看起来像你的phpmyadmin配置为显示导出为文本,而不是下载文件。 要下载文件,请为导出方法选择自定义。 然后在输出部分选择保存输出到文件。 这是您需要更改的唯一设置。 然后运行导出,它会正确下载文件。 一旦你完成了这一次,快速导出应该再次正确工作。


The code you are seeing is the contents of the .sql file that would be exported. It looks like somehow your phpmyadmin got configured to display the export as text instead of downloading the file. To download the file, select custom for the export method. Then in the output section select save output to file. That is the only setting you need to change. Then run the export and it will correctly download the file. Once you have done this once, the quick export should work correctly again.

相关问答

更多
  • 经过大量的讨论后,事实证明问题是PHP对大于6MB的文件施加的限制。 在6MB的查询后,它会在那里切断它,然后在逻辑上抛出错误。 解决方案是更改它们,或者在我的情况下,因为我没有直接访问配置文件:SSH导入成功。 After a lot of headbanging it turns out that the problem was limitations imposed by PHP for files larger than 6MB. After 6MB of query it would just c ...
  • 如果您需要将所有小动物选入新表,则需要使用此查询: CREATE TABLE small_animals SELECT * FROM animals WHERE animal_size = 'small' 如果您需要真正的临时表,那么只需将TEMPORARY添加到查询中: CREATE TEMPORARY TABLE small_animals_temp SELECT * FROM animals WHERE animal_size = 'small' 更新:由于phpMyAdmin中解析器中存在问题, ...
  • 此错误的最常见原因是外键约束与另一个表中的名称相同。 外键的名称在数据库中必须是唯一的(不仅仅是在表级别)。 在数据库的另一个表中是否有requester_id ? The most common reason for this error is that the foreign key constraint have the same name as in another table. Foreign keys' names must be unique in the database (not just ...
  • 添加一个按钮,并在后端执行此MYSQL命令行命令,使用exec的php按钮单击。 mysqldump -u'username' -p'password' database_name > /path/backup.sql 您可以使用下面给出的代码直接在浏览器中下载文件 $fileName = "/path/backup.sql"; if (file_exists($fileName)) { header('Content-Description: File ...
  • 这完全没问题,没有错。 当我们导出数据库时,SQL会压缩它,这就是为什么导出的数据库的大小小于实际大小的原因。 所以不用担心:) It is totally fine, there is nothing wrong. When we export database, SQL compress it, so that's why the size of exported database is less than the actual size. so no worries :)
  • 您看到的代码是将要导出的.sql文件的内容。 它看起来像你的phpmyadmin配置为显示导出为文本,而不是下载文件。 要下载文件,请为导出方法选择自定义。 然后在输出部分选择保存输出到文件。 这是您需要更改的唯一设置。 然后运行导出,它会正确下载文件。 一旦你完成了这一次,快速导出应该再次正确工作。 The code you are seeing is the contents of the .sql file that would be exported. It looks like somehow y ...
  • 调整MySQL的lower_case_table_names设置以实现目标。 请参见如何强制区分大小写的表名称? Adjust your lower_case_table_names setting for MySQL to achieve your goal. See How to force case sensitive table names?
  • Phpmyadmin始终受本地PHP设置的限制。 如果你有shell访问权限,我会推荐你使用mysqldump命令 。 shell> mysqldump [options] db_name [tables] shell> mysqldump [options] --databases db_name1 [db_name2 db_name3...] shell> mysqldump [options] --all-databases Phpmyadmin is always limited by the l ...
  • 您可以查看phpMyAdmin源代码(开源软件的一个优点)。 检查export.php脚本和libraries / export / sql.php脚本文件中的支持函数。 总之,phpMyAdmin的作用是: 获取给定数据库中的表列表(SHOW TABLES FROM ...), 获取每个表的创建查询(SHOW CREATE TABLE ...), 解析它并从中提取列定义, 获取所有数据(SELECT * FROM ...) 根据列数据构建查询。 我为自己的应用程序编写了类似的代码(用于备份目的,当phpM ...
  • 请参阅引用的脚本连接到数据库服务器本身。 它不期望转储! ./mysql2sqlite -h example.com -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite 这是脚本应该执行的方式。 使用host,username,passwort和要转储的mysql数据库。 由于数据库转储和DBMS功能在不同的DBMS(如MySQL和sqlite3)之间可能会有很大差异,我建议安装本地MySQL服务器而不是使用sqlite3。 当您对sq ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)