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?
时间: 2023-12-03 22:46:55 浏览: 31
The line that should be added to the crontab file to copy /etc/passwd to the home directory on every Monday at 3 o'clock is:
```
0 3 * * 1 cp /etc/passwd /home/user/
```
Explanation:
- The first field `0` specifies the minutes when the command will run (i.e. 0 minutes).
- The second field `3` specifies the hour when the command will run (i.e. 3 AM).
- The third field `*` specifies the day of the month when the command will run (i.e. any day of the month).
- The fourth field `*` specifies the month when the command will run (i.e. any month).
- The fifth field `1` specifies the day of the week when the command will run (i.e. Monday).
- Finally, the command `cp /etc/passwd /home/user/` is the command that will be executed at the specified time.