我有一个脚本来做点东西,它很好用,但是 我想将此脚本放在rc.local中,因为每次Linux重新启动时,它都会在启动时启动
我在rc.local中执行了操作,但这不起作用
nano rc.local
/root/myscript &
我这样尝试
nano rc.local
/root/myscript
再次对我不起作用。脚本还可以,每次我运行这样的脚本时,它都能正常工作
cd root/
./myscript
plz帮助
答案 0 :(得分:-1)
WHERE
Year = '2016'
OR (Year = '2017' AND CustID NOT In ('AB17','AB18'))
应该是开箱即用的,因此,如果您使用的是import { from } from 'rxjs';
import { map } from 'rxjs/operators';
interface MyTest {
property2: string
}
class Example {
private getAutocompleteSuggestions() {
return from([{"property1":"Property1","property2":"Property2","property3":"Property3"}]);
}
public incrementCounter() {
this.getAutocompleteSuggestions().pipe(map(data => { return { property2: data.property2}})).subscribe((data: MyTest) => {
console.log(data);
});
}
}
new Example().incrementCounter();
并弹出一个空文件,则说明您做错了什么(可能在错误的目录中),并且创建一个新文件,操作系统将不会自动启动该文件。
例如,如果您在Ubuntu中运行rc.local
,则会得到以下信息:
nano
据我所知,根据article,centOS中的cat -n /etc/rc.local
位于#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
exit 0
中,因此请尝试运行以下命令:
rc.local