Having error on setup automatic backup

Continuing the discussion from How to setup schedulers and automatic backups?:

having this error on logs
python: can’t open file ‘lib/wnf.py’: [Errno 2] No such file or directory

The instruction on the given URL is outdated and no longer used.

Now, we use bench --site all backup --with-files command to take backup of database and files.

Can you give me all the command to schedule backup?

0 */6 * * * cd /path-to-your-frappe-bench-directory && /bin/bench --site all backup >> /path-to-your-frappe-bench-directory/logs/backup.log 2>&1

Put the above command in crontab, to schedule backup at 6 hours interval.

1 Like

i have this on logs
-bash: /bin/bench: No such file or directory

Try this one:

0 */6 * * *  cd /path-to-your-frappe-bench-directory && /path-to-your-frappe-bench-directory/env/bin/bench --site all backup >> /path-to-your-frappe-bench-directory/logs/backup.log 2>&1

i dont know why but the bench file is not in the path

-bash: /home/frappe/frappe-bench/env/bin/bench: No such file or directory

any issue if i put the code like this?

cd /home/frappe/frappe-bench/ && bench backup-all-sites >> /home/frappe/frappe-bench//logs/backup.log 2>&1

i got it is on this path
cd /home/frappe/frappe-bench && /usr/local/bin/bench --site all backup >> /home/frappe/frappe-bench/logs/backup.log 2>&1

thank you

1 Like