我正在尝试将一个格式的音乐文件转换.gsm
为 format .wav
。这就是我尝试的方式:
for f in *.gsm; do sox $f new/${f%.wav}; done
结果是我在目录中得到了相同格式的相同.gsm
文件new/
。
谁能指出这里的问题是什么?
我在安装 mysql 时遇到问题,我无法单独解决。首先,我尝试使用此命令删除和清除旧文件
sudo apt-get remove --purge mysql
也试过
sudo apt-get remove --purge mysql*
和
sudo apt-get remove --purge mariadb*
所有 3 个命令都返回相同的输出...
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
dbconfig-mysql : Depends: mysql-client but it is not going to be installed or
mariadb-client but it is not going to be installed or
virtual-mysql-client
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
所以我运行建议我的东西apt-get -f install
,我得到了
$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
mysql-server-5.7
Suggested packages:
mailx tinyca
The following NEW packages will be installed:
mysql-server-5.7
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/2,597 kB of archives.
After this operation, 48.3 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
(Reading database ... 300885 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.7_5.7.16-0ubuntu0.16.04.1_amd64.deb ...
Aborting downgrade from (at least) 10.0 to 5.7.
If are sure you want to downgrade to 5.7, remove the file
/var/lib/mysql/debian-*.flag and try installing again.
dpkg: error processing archive /var/cache/apt/archives/mysql-server-5.7_5.7.16-0ubuntu0.16.04.1_amd64.deb (--unpack):
subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/mysql-server-5.7_5.7.16-0ubuntu0.16.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
运行时得到的输出相同apt upgrade -f
。这是的输出systemctl status mysql.service -l
$ systemctl status mysql.service -l
● mysql.service
Loaded: not-found (Reason: No such file or directory)
Active: failed (Result: exit-code) since Wed 2016-11-23 07:32:55 EET; 58min ago
Nov 23 07:32:24 stan systemd[1]: Starting LSB: Start and stop the mysql database server daemon...
Nov 23 07:32:24 stan mysql[7818]: * Starting MariaDB database server mysqld
Nov 23 07:32:55 stan mysql[7818]: ...fail!
Nov 23 07:32:55 stan systemd[1]: mysql.service: Control process exited, code=exited status=1
Nov 23 07:32:55 stan systemd[1]: Failed to start LSB: Start and stop the mysql database server daemon.
Nov 23 07:32:55 stan systemd[1]: mysql.service: Unit entered failed state.
Nov 23 07:32:55 stan systemd[1]: mysql.service: Failed with result 'exit-code'.
我尝试过的另一件事是删除mysql-server
然后再次安装它仍然是同样的错误。
任何人都可以帮助解决这个问题。我不知道如何解决它。
更新输出lsb_release -a
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial
更新2:输出sudo apt install mysql-server mysql-client
$ sudo apt install mysql-server mysql-client
Reading package lists... Done
Building dependency tree
Reading state information... Done
mysql-client is already the newest version (5.7.16-0ubuntu0.16.04.1).
mysql-server is already the newest version (5.7.16-0ubuntu0.16.04.1).
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
mysql-server : Depends: mysql-server-5.7 but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
我知道有很多类似的问题,我已经尝试了很多东西,但仍然无法让它发挥作用。
我有计划在 10 分钟运行的 cronjob。我可以看到/var/log/syslog
它运行正常
Oct 21 07:30:01 stan CRON[7604]: (stan) CMD (stan /home/stan/update.sh)
Oct 21 07:40:01 stan CRON[8304]: (stan) CMD (stan /home/stan/update.sh)
Oct 21 07:50:01 stan CRON[8751]: (stan) CMD (stan /home/stan/update.sh)
Oct 21 08:00:01 stan CRON[9347]: (stan) CMD (stan /home/stan/update.sh)
Oct 21 08:10:01 stan CRON[9789]: (stan) CMD (stan /home/stan/update.sh)
update.sh
调用php
更新数据库的脚本。当我直接从终端运行时,shell 脚本数据库已更新并且运行良好
./update.sh
但是来自 cronjob 不会更新数据库。我的 cron
*/10 * * * * stan /home/stan/update.sh
从 shell 脚本产生的命令是
/usr/bin/php /var/www/html/site/update.php
两个文件的权限
-rwxrwxr-x 1 stan stan 123 Oct 20 15:09 update.sh
-rwxr-xr-x 1 stan www-data 1301 Oct 21 07:52 /var/www/html/site/update.php
知道可能是什么问题吗?
更新:路径
$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
update.sh
$ cat update.sh
#!/bin/sh
list="/var/www/html/site"
config="/usr/bin/php"
for i in "$list"
do
"$config" "$i"/update.php
done
参考我昨天关于 shell 的问题,现在 php 是关于 cron 的。
$ whereis php
php: /usr/bin/php5.6 /usr/bin/php /usr/lib/php /etc/php /usr/include/php /usr/share/php5.6-intl /usr/share/php7.0-mbstring /usr/share/php7.0-common /usr/share/php5.6-curl /usr/share/php5.6-gd /usr/share/php5.6-mcrypt /usr/share/php5.6-common /usr/share/php5.6-readline /usr/share/php5.6-json /usr/share/php /usr/share/php5.5-mbstring /usr/share/php5.6-opcache /usr/share/php5.6-mbstring /usr/share/php5.6-xml /usr/share/php5.5-common /usr/share/php5.6-mysql /usr/share/man/man1/php.1.gz
$ which php
/usr/bin/php
我正在尝试一些简单但无法弄清楚的事情。尝试运行一个从站点目录调用 php 脚本的 shell 脚本。我的 shell 脚本很简单test.sh
:
#!/bin/sh
LIST="/path/to/my/site/dir"
CONFIG="/usr/bin/php "
for i in $LIST
do
. "${CONFIG}${i}/test.php"
done
我test.php
没有错误,当我直接在浏览器中运行它时它正在工作。它再次简单的脚本,如
<?php
// source code
?>
当我运行./test.sh
结果是
./test.sh: 8: .: 无法打开 /usr/bin/php /path/to/my/site/dir/test.php
8号线是. "${CONFIG}${i}/test.php"
我也尝试在 PHP 文件的开头添加这一行,但结果是一样的
#!/usr/bin/php
更新:php的路径
$ which -a php
/usr/bin/php
我也做过chmod +x test.php