# at jobs

### Use at: &#x20;

Syntax:

```bash
at <date> - This will run the command at the specified time/date 
```

Example:

```bash
at 12:30am Aug 20 
```

**After this command you will be prompted to enter the commands that you want to run:**  &#x20;

### How to schedule a job:&#x20;

1. Check the date with the `date` command in Linux to get the time&#x20;
2. Schedule the job &#x20;

#### 2.1 Schedule Job from File/Script: &#x20;

&#x20; Syntax:

```bash
at –vf <path/to/script/and/script/name.sh> <time>  
```

Flags:

```bash
-f = takes file to execute (script) 
-v = displays date when the job will be executed 
```

Example:

```bash
at -vf path/to/script now 
```

&#x20;

#### 2.2 Schedule Job from Command: &#x20;

Syntax:&#x20;

```bash
at <time>  
```

This will open a prompt for input&#x20;

• Enter command / commands you want to run  • Once finished press CTRL + D    &#x20;

### Check if the job is scheduled:&#x20;

&#x20; Command:&#x20;

```bash
atq 
```

This will display the job schedule number first, the date when it will execute second and the user under which this executes third.  &#x20;

### Removing incorrect job:&#x20;

&#x20; If the job is not scheduled correctly, you can remove this with:  Command:&#x20;

```bash
atrm <jobnumber> 
```

Example:   The job scheduled below is the job with number 36  To remove the job the command used was: atrm 36  After executing this command, you can check if it was removed with `atq`&#x20;

&#x20;

### Extra Info:&#x20;

To schedule a job 1h from now you can use the following command:&#x20;

```bash
at –vf </path/to/script.sh> now + 1 hour 
```

Check the content of a Job:&#x20;

```bash
at –c <job_number>
```
