How to back up user from admin account

Hello, lets say i have admin account called admin and single user called hoster

I want to create cron job that will backup automatically this user form my admin account, or need i to login into users account?

i go into my admin account then cron job and add command like ethis?

which one is form here the right one?

/usr/local/hestia/bin/v-backup-user hoster

sudo /usr/local/hestia/bin/v-backup-user hoster

sudo v-backup-user hoster

v-backup-user hoster

the admin account do not have SUDO permission, I think you better add the job at

Settings → Configure → Panel Cronjobs

This is using the HestiaCP system account to perform SUDO

Thanks for answer

I went to panel cronjob

There was codes like these:

MAILTO=""
CONTENT_TYPE="text/plain; charset=utf-8"
*/2 * * * * sudo /usr/local/hestia/bin/v-update-sys-queue restart
10 00 * * * sudo /usr/local/hestia/bin/v-update-sys-queue daily
15 02 * * * sudo /usr/local/hestia/bin/v-update-sys-queue disk
10 00 * * * sudo /usr/local/hestia/bin/v-update-sys-queue traffic
30 03 * * * sudo /usr/local/hestia/bin/v-update-sys-queue webstats
*/5 * * * * sudo /usr/local/hestia/bin/v-update-sys-queue backup
20 00 * * * sudo /usr/local/hestia/bin/v-update-user-stats
*/5 * * * * sudo /usr/local/hestia/bin/v-update-sys-rrd
44 4 * * * sudo /usr/local/hestia/bin/v-update-letsencrypt-ssl
41 4 * * * sudo /usr/local/hestia/bin/v-update-sys-hestia-all
10 05 */5 * * sudo /usr/local/hestia/bin/v-backup-users

Then i removed last line and added this line and ia it correct?

10 05 */5 * * sudo /usr/local/hestia/bin/v-backup-users && sudo ls -t /backup/*/*.tar | awk 'NR>20' | xargs -r sudo rm --

Will this work?

You want to remove old backup when more than 20? or I understanding it wrong?

Yes righti just want to check if i add that code in that panel will it work? I added via ssh in crontab of vps and it works but want to know if i can add it directly in hestia web panel

Actually, there is a control of how many backup to retain in here:

Main page → Package → Default.

You can create a separate package if you want different setting for different users

But i want ti delete the oldest one and create 21th backup

In package i can only chose Maximal number of allowed backup

If i didn’t understand it wrong

If you set 20 in that field, it will keep latest 20 backups and delete the oldest one (21)

Are u sure?

Ok and how can i generally add cronjob for backup specific user? What is best orqctise rather than adding code as a showed above

I am sure for this. The oldest backup will be removed (my server did this automatically)

If you set 20 in that field, it will keep latest 20 backups and delete the oldest one (21)