Files and scheduled tasks
Upload, edit, compress and extract files with the file manager, and run commands in the container on a cron schedule.
This guide covers two tabs on the Dedicated Container page, File manager and Scheduled tasks. It explains how to upload, edit, compress and extract files, and how to run commands on a schedule inside the container.
File manager
Open the container page and switch to the File manager tab. The file manager's root / is the container's site and application directory, /var/www/html. You can browse and change only this directory and its subdirectories.
Browsing and editing
- Click a directory name to open it. Use the breadcrumb path at the top to go back up.
- The list shows Name, Size, modification time and Permissions.
- Click the More (
⋯) button next to a file for these actions:
| Action | Description |
|---|---|
| Edit | Open a text file in the browser, change it and save |
| Download | Download the file to your computer |
| Rename | Rename a file or directory |
| Compress | Pack a file or directory as tar.gz or zip |
| Extract | Shown only for .tar.gz and .zip files. Extracts into a directory with the archive's name |
| Delete | Delete a file or directory. This can't be undone |
Creating, uploading and remote download
The toolbar has these buttons:
- Upload: upload a local file into the current directory.
- Remote download: enter a Download URL, such as
https://example.com/file.zip, and a Save filename name. The server downloads the file straight into the current directory. The download runs in the background with a progress indicator, and "Remote download complete" appears when it finishes. - Create: choose a type (file or directory) and enter a name.
- Refresh: reload the current directory.
If your project has many small files (for example a Node.js app with node_modules), pack it as a .zip or .tar.gz on your computer, upload it or fetch it with Remote download, then Extract it here. This is much faster than uploading files one by one.
Compression and extraction also run in the background. You'll see "Compression complete" or "Extraction complete" when they finish.
File permissions
Apps and scheduled cron jobs run as the container's www user. If you run into permission problems, click Fix permissions under Quick actions on the Overview tab. This resets the owner and permissions of /var/www/html.
Scheduled tasks (cron)
The Scheduled tasks tab runs commands inside the container on a cron schedule. Typical uses are running the Laravel scheduler, clearing caches or taking periodic backups.
Creating a scheduled task
Switch to the Scheduled tasks tab and click Create task.
Fill in the form:
Field Description Task name A name that helps you recognise the task, e.g. backup_databaseSchedule A standard 5-field cron expression: minute, hour, day of month, month, day of week, e.g. */5 * * * *. Use Quick select to pick a common presetCommand The command to run. Use absolute paths, e.g. /usr/bin/php /var/www/html/artisan schedule:runRun as user The user that runs the command Description Optional notes Save. The task then appears in the list.
New tasks start out disabled. After you create a task, turn on its switch in the Status column, or it won't run on schedule. After you edit a task, check that the switch is still set to Enable.
Cron expressions
An expression has five fields with these ranges:
| Field | Range |
|---|---|
| Minute | 0–59 |
| Hour | 0–23 |
| Day of month | 1–31 |
| Month | 1–12 |
| Day of week | 0–7 (both 0 and 7 mean Sunday) |
Common examples:
* * * * * every minute
*/5 * * * * every 5 minutes
0 * * * * at the top of every hour
0 0 * * * every day at 00:00
0 12 * * * every day at 12:00
0 0 * * 1 every Monday at 00:00
0 0 1 * * on the 1st of every month at 00:00Managing tasks
The list shows Schedule, Command, Run as user and Status. Each row has these controls:
- Status switch: enable or disable the task.
- Run now (the play icon): run the command once right away and show its output. This is useful for debugging.
- Edit: change the schedule, command and other fields.
- Delete: delete the task after you confirm.
Writing good commands
- Scheduled runs use the container's
wwwuser, so that user must be able to read and write the files your command uses. - Don't put single quotes (
') in the command. For complex logic, put the commands in a script such as/var/www/html/cron.shand have the task runsh /var/www/html/cron.sh. - To keep a record of each run, redirect the output yourself, e.g.
... >> /var/www/html/storage/cron.log 2>&1.
About the web terminal
The container page also has a Web terminal tab.
At the time of writing, this guide doesn't cover the interactive terminal. For day-to-day work, use the file manager, cron's Run now and the logs in App management.