- Documentation
File Storage vePFS
Best Practices
Back up data from vePFS to object storage on a regular schedule using the tosutil tool
Best Practices
Back up data from vePFS to object storage on a regular schedule using the tosutil tool
Back up data from vePFS to object storage on a regular schedule using the tosutil tool
This article describes how to use the tosutil tool to back up data from vePFS to TOS object storage.
vePFS provides data migration features. We recommend using these features for a better experience. For details, refer to Data Migration Overview. Use cases
- The core training data stored in vePFS is highly sensitive and requires regular backups to ensure data security.
- Checkpoint data generated during training should be regularly synced to the object storage to promptly free up vePFS storage space.
Prerequisites
- The bandwidth of both ECS and object storage meets backup requirements.
- For object storage bandwidth constraints, refer to Limitations.
- File storage vePFS has already been mounted on ECS. For step-by-step instructions, see Mount vePFS.
Steps
Step 1: Set up scheduled backups for vePFS data
- Log in to Cloud Service ECS.
- Run the following command to create directories for storing backup scripts and log files. This example creates the backp directory.
- Run the following command to create a backup script. for example, backup_vepfs_to_tos.sh , and open it with a text editor.
vim backup_vepfs_to_tos.sh
- Add backup information to the script.
tip
This backup command performs incremental backups, copying only new and modified files in vePFS to object storage.
source_path="/mnt/vepfs/backup/files"
bucket_name="your-tos-bucket"
log_file="/opt/backup/backup.log"
start_time=$(date +%Y-%m-%d_%H:%M:%S)
echo "Start vepfs backup to tos: $start_time" >> $log_file
tosutil cp -r -u -j $jobs -p $parallel $source_path tos://$bucket_name >> $log_file 2>&1
end_time=$(date +%Y-%m-%d_%H:%M:%S)
echo "Finish vepfs backup to tos: $end_time" >> $log_file
- Backup parameter details:
Step 2: Configure scheduled tasks
- Run the following command to grant execution permission to the backup script.
chmod +x backup_vepfs_to_tos.sh
- Run the following command to create and edit a cron job.
- Add the backup content to the cron table. For example, back up once daily at midnight. For detailed command configuration, see Appendix.
0 0 * * * /bin/bash /opt/backup_vepfs_to_tos.sh
- Check the start and end time of the backup, as well as backup details, in the backup.log file.
tip
Backup details include: length of time, number of successfully backed up files, number of failed files, number of skipped files, and backup file size.
-
Appendix: crontab scheduled policy description
Cron format: * * * * * [your command]
The parameters are described below.
Here are some common examples.
Last updated: 2026.03.03 10:39:10