Synchronizing Files¶
This guide provides instructions on how to sync files to your device. You can use the automated sync.sh
script for a streamlined experience, or follow the manual instructions for more control.
Automated Syncing with sync.sh
¶
The scripts/sync.sh
script provides an easy way to synchronize a local directory with the device's microSD card over FTP. It uses lftp to mirror the contents, deleting any files on the device that are not present locally.
Dependencies¶
You must have lftp
installed on your system.
Configuration¶
There are two ways to configure the script:
- Copy the template
.env
File (Recommended):
- Edit
scripts/.env
with your device's IP address, FTP credentials, and web server credentials (if authentication is enabled).
scripts/.env
Tip
You can override the .env
file settings by passing environment variables directly.
Script Usage¶
- Make sure the device is in FTP Server Mode.
- Run the script from the scripts directory:
Example with Command-Line Arguments:
This command syncs a specific local directory to the device, overriding any settings in .env
. If the web server is authenticated, you must also pass the credentials.
./scripts directory
Manual Syncing¶
If you don't want to use the sync.sh
script, you can manually sync a directory using lftp
.