Vous avez un album entier dans un seul fichier .ape, accompagné d’un fichier .cue, et vous voulez obtenir une piste par morceau ?
C’est exactement le rôle du fichier CUE.
Le fichier .ape contient l’audio complet de l’album. Le fichier .cue contient la table des pistes : titres, artistes, index, durée, ordre des morceaux et parfois informations de CD audio.
Autrefois, on passait par Winamp, EAC, un plugin de sortie WAV et un outil comme Medieval CUE Splitter. Cette méthode fonctionnait, mais elle est datée. Aujourd’hui, il vaut mieux utiliser CUETools, foobar2000 ou une ligne de commande propre avec shntool.
A good backup is not a command you copied from a forum in 2005.
A good backup is automated, readable, logged, rotated, stored away from the server, and tested before disaster strikes. Cron can still handle the scheduling part perfectly well. However, the backup command itself needs a little more care than a one-liner thrown into cPanel.
This guide shows a modern way to back up website files and MySQL or MariaDB databases with cron. It works well for small and medium websites, WordPress installs, forums, static sites and custom PHP applications.
If you run a large database, a busy WooCommerce shop or a high-write application, treat this as a baseline. You may need replica-based backups, physical backups, binary logs, snapshots or managed backup tooling.
What should a backup include?
For most websites, you need two things:
the website files, such as themes, plugins, uploads, media and custom code;
the database, which contains posts, pages, users, settings, orders, comments and application data.
Backing up only the files is not enough. Backing up only the database is not enough either. A WordPress site without its database is a cupboard with no shelves. A database without uploads is a library with missing pages.
The old one-liner approach
The old version of this tutorial used two simple cron commands: one for tar, one for mysqldump.
date=`date -I`; tar -zcf backup_$date.tgz ./public_htmlLangage du code :JavaScript(javascript)
Those commands are useful for learning the concept. They are not ideal for production.
The database password appears directly in the cron command.
The backup stays on the same server.
There is no retention policy.
There is no log file.
There is no restore test.
The files archive may include cache directories and previous backups.
The command becomes hard to maintain as the site grows.
So, let’s keep the simplicity of cron, but move the logic into a small shell script.
Create a backup directory
First, create a directory for local temporary backups. This directory should not be publicly accessible from the web.
mkdir -p "$HOME/backups"
chmod 700"$HOME/backups"Langage du code :JavaScript(javascript)
Do not store backups inside public_html, htdocs, www or any public web root. A database dump exposed on the web is not a backup. It is a gift basket for attackers.
Store database credentials safely
Avoid putting database passwords directly in cron. Instead, create a protected MySQL option file.
nano "$HOME/.my.cnf"Langage du code :JavaScript(javascript)
chmod 600"$HOME/.my.cnf"Langage du code :JavaScript(javascript)
The backup user should only have the privileges it needs. For many simple sites, read-oriented privileges are enough. If you dump stored routines, triggers or events, you may need additional privileges depending on your MySQL or MariaDB version and configuration.
Use mysqldump or mariadb-dump?
Use the dump tool that matches your database server.
Database server
Recommended command
Notes
MySQL
mysqldump
Official MySQL logical backup utility.
MariaDB
mariadb-dump
Modern MariaDB name. mysqldump may still exist as a compatibility alias on some systems.
For a small WordPress site on MySQL, mysqldump is still fine. For MariaDB, prefer mariadb-dump when available.
Check what your server provides:
command -v mysqldump
command -v mariadb-dump
A modern cron backup script
Create a script outside the public web root:
mkdir -p "$HOME/bin"
nano "$HOME/bin/site-backup.sh"Langage du code :JavaScript(javascript)
Paste this version and adjust the paths at the top.
chmod 700"$HOME/bin/site-backup.sh"Langage du code :JavaScript(javascript)
Then run it manually before adding it to cron:
"$HOME/bin/site-backup.sh"Langage du code :JSON / JSON avec commentaires(json)
If the manual run fails, fix that first. Cron will not magically make a broken command better. Cron is punctual, not merciful.
For MariaDB, switch the dump command
If your server runs MariaDB and provides mariadb-dump, change this line:
DB_DUMP_COMMAND="mysqldump"Langage du code :JavaScript(javascript)
to:
DB_DUMP_COMMAND="mariadb-dump"Langage du code :JavaScript(javascript)
If you later restore the dump on a different system, test compatibility first. Recent MariaDB dump files may include MariaDB-specific directives that older clients or MySQL clients do not understand.
Back up all databases or one database?
The old tutorial used --all-databases. That can still make sense on a small VPS where you control every database.
For shared hosting or a single website, backing up only the relevant database is cleaner:
The --single-transaction option is especially useful with InnoDB tables because it creates a consistent snapshot without locking normal reads and writes for the full duration of the dump.
Exclude cache and temporary files
Do not back up everything blindly. Cache folders can make backups huge, slow and noisy.
For WordPress, common exclusions include:
wp-content/cache
wp-content/upgrade
wp-content/uploads/cache
wp-content/debug.log
plugin-specific cache directories
previous backup archives
GNU tar supports exclusion patterns with --exclude and exclusion files with --exclude-from. For a larger setup, move exclusions into a dedicated file.
nano "$HOME/backup-excludes.txt"Langage du code :JavaScript(javascript)
Use absolute paths in cron. Your interactive shell and cron do not always share the same environment, PATH or working directory.
On cPanel, use the Cron Jobs interface and paste the same command. Adjust the path to match your hosting account:
/home/cpanel-user/bin/site-backup.sh >> /home/cpanel-user/backups/cron.log 2>&1Langage du code :JavaScript(javascript)
Do not keep backups only on the same server
A local backup is useful for quick restores. It is not enough.
If the disk fails, the account is deleted, the server is compromised or the hosting provider has an incident, local backups can disappear with the original data.
At minimum, copy backups to another location:
another server via rsync over SSH;
object storage such as S3-compatible storage;
a backup server provided by your host;
a dedicated backup tool such as BorgBackup, Restic or Rclone.
For a simple remote copy with rsync:
rsync -az --delete"$HOME/backups/" backup-user@backup.example.com:/srv/backups/example-site/Langage du code :JavaScript(javascript)
Add this only after SSH keys and permissions are correctly configured. The remote backup user should have limited access to the backup directory, not full access to the server.
Check that backups can be restored
A backup you never restore is only a hopeful archive.
Test the database dump regularly on a staging machine or local environment:
gunzip -c wordpress_database.sql.gz | mysql staging_database
Test the file archive too:
tar -tzf example-site_files.tar.gz | head
Verify checksums:
cd /path/to/backup-directory
sha256sum -c SHA256SUMS
For WordPress, a real restore test means checking that the site loads, the admin works, uploads are present, permalinks work and key plugin data survived the import.
Recommended backup frequency
The right schedule depends on how often your data changes.
Site type
Database backup
Files backup
Comment
Static or brochure site
Weekly
Weekly
Increase before updates.
Blog with regular posts
Daily
Daily or weekly
Uploads matter when publishing.
Forum or membership site
Daily or more
Daily
User activity changes often.
WooCommerce shop
Hourly or managed backups
Daily
Orders make daily-only backups risky.
Development site
Before major changes
Before major changes
Automate if clients edit content.
For WooCommerce, daily backups can lose orders. Use your host’s continuous backups, database binlogs, a transactional backup service, or a custom strategy that matches your recovery point objective.
Cron or systemd timers?
Cron is still perfectly fine for simple scheduled backups. It is available almost everywhere, including shared hosting and cPanel.
On a modern VPS, systemd timers can be cleaner. They integrate with journalctl, handle missed runs better and offer more explicit service definitions. Still, cron wins when portability matters.
Use cron when you want the simplest path. Use systemd timers when you manage the whole server and want stronger observability.
Security checklist
Store backups outside the public web root.
Use chmod 600 for database credential files.
Use a dedicated database backup user.
Do not put passwords directly in cron.
Compress dumps, but do not rely on compression as security.
Encrypt off-server backups if they contain personal data.
Limit remote backup SSH keys.
Rotate old backups automatically.
Monitor failed cron runs.
Test restores regularly.
Quick troubleshooting
If the script works manually but not in cron, check these first:
use absolute paths everywhere;
check file permissions;
redirect cron output to a log file;
verify that mysqldump or mariadb-dump is in cron’s PATH;
check that $HOME resolves as expected;
confirm the backup user can read the database;
check available disk space before compression.
Useful commands:
df -h
du -sh "$HOME/backups"
tail -100"$HOME/backups/cron.log"
command -v mysqldump
command -v mariadb-dumpLangage du code :JavaScript(javascript)
Conclusion
Cron remains a solid way to automate website backups. The mistake is not cron. The mistake is treating a backup as a one-line afterthought.
Put the logic in a script, keep credentials out of the crontab, dump the database with consistent options, exclude cache files, rotate old archives, copy backups off-server and test restoration. That gives you a backup process you can actually trust when something breaks.
Because the only backup that matters is the one that restores cleanly. Everything else is decorative gzip.
Concert de Mercury Rev hier soir à Nantes : mythique ! Et je pèse mes mots. Je classe ce concert dans mon Top 5 des meilleurs, à côté de celui de Page et Plant.
Il est rare de voir un groupe aussi bien jouer ensemble : c’était plus que de l’harmonie, cela frisait la symbiose fusionnelle.
Au niveau musical, j’ai été surpris de voir que toutes les nuances présentes sur les albums ont été respectées tout en ajoutant le petit quelque chose de plus qui fait que l’on ne se retrouve pas avec un concert similaire à l’album mais à une véritable représentation.
Les musiciens ont joué comme des prodiges – je salue ici la performance du bassiste et du batteur dont les performances m’ont littéralement scotché à mon siège : le bassiste (Dave Fridmann), avec son look entre disco et heavy-métal, nous a ravi de licks énormes tout au long du concert et le batteur (Jeff Mercel), d’une pêche incroyable, s’est même mis debout pour taper plus fort au milieu du concert. Tout simplement phénoménal.
Au niveau scénique, une bande vidéo a défilé tout le long du concert, projetant des images et des citations de grands auteurs (Sartre, Gide, Krishnamurti, William Blake, Edith Warton, Yoda, Lao Tseu, Jonathan Levingstone the Seagull…), ce qui a ajouté quelque chose de plus au concert.
Le mélange audio et vidéo a en quelque sorte donné plus de sens à la musique et nous a offert quelques jolies pistes de réflexion sur la vie et le contact avec l’autre.
Le chanteur, Jonathan Donahue, habillé en dandy dans la plus pure tradition britannique, a mené son groupe de main de maître, lâchant à plusieurs reprises sa guitare pour diriger son groupe à la manière d’un chef d’orchestre, dos au public, s’adressant au clavier et au guitariste, connu sous le nom de Grasshopper et qui ressemble un peu à Elvis dans sa manière de saluer le public avec ses deux doigts pointés en avant, tel un pistolero.
Mercury Rev nous a joué pas mal de morceaux de l’album Deserter’s Songs et du petit dernier The Secret Migration et nous a offert deux magnifiques rappels pour conclure sur Goddess on a Highway, l’un de leurs titres les plus rocks.
Le public ne s’y est pas d’ailleurs trompé puisqu’il y a eu trois standing ovations et plusieurs minutes d’applaudissements.
J’ai découvert Mercury Rev en Autralie en 1999 et je suis vraiment heureux d’avoir pu assister à ce concert hier soir.
Si jamais vous avez l’occasion de les voir en concert, n’hésitez pas et foncez. Vous ne le regretterez pas ! ^_^