You want to copy /etc/passwd to your home directory on 3 o'clock every Monday. What's the line that you should put in the crontab file?
时间: 2023-12-03 11:44:17 浏览: 94
The line that should be put in the crontab file to copy /etc/passwd to the home directory at 3 o'clock every Monday is:
```
0 3 * * 1 cp /etc/passwd /home/your_username/
```
This line specifies the following:
- `0 3 * * 1`: This means the command will run at 3:00 AM on any day of the month, any month, but only on Monday (`1` is the number assigned to Monday in cron).
- `cp /etc/passwd /home/your_username/`: This is the command that will be executed, which will copy the `/etc/passwd` file to your home directory.
相关问题
2.You want to copy /etc/passwd to your home directory on 3 o'clock every Monday. What's the line that you should put in the crontab file?
The line that should be put in the crontab file to copy /etc/passwd to the home directory at 3 o'clock every Monday is:
```
0 3 * * 1 cp /etc/passwd /home/username/
```
Explanation:
- `0 3` indicates the time at which the command should run (3:00 am).
- `* *` indicates that the command should run every day and every month.
- `1` indicates that the command should run only on Mondays.
- `cp /etc/passwd /home/username/` is the command that will be executed. Note that you should replace "username" with your actual username.
阅读全文