| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- #!/bin/bash
- # info: listing system bakups
- #----------------------------------------------------------#
- # Variable&Function #
- #----------------------------------------------------------#
- # Argument defenition
- user=$1
- format=${2-shell}
- # Importing variables
- source $VESTA/conf/vars.conf
- source $V_FUNC/shared.func
- #----------------------------------------------------------#
- # Verifications #
- #----------------------------------------------------------#
- # Checking args
- check_args '1' "$#" 'user [format]'
- # Checking argument format
- format_validation 'user'
- # Checking user
- is_user_valid
- #----------------------------------------------------------#
- # Action #
- #----------------------------------------------------------#
- conf=$V_USERS/$user/backup.conf
- if [ ! -e "$conf" ]; then
- touch $conf
- fi
- # Defining fileds to select
- fields="\$DATE \$TIME \$RUNTIME \$TYPE \$SIZE \$WEB \$DNS \$DB \$MAIL"
- fields="$fields \$CERTIFICATES \$CRON"
- # Listing domains
- case $format in
- json) json_list ;;
- plain) nohead=1; shell_list ;;
- shell) fields='$DATE $TIME $RUNTIME $TYPE $SIZE';shell_list |column -t ;;
- *) check_args '1' '0' '[format]' ;;
- esac
- #----------------------------------------------------------#
- # Vesta #
- #----------------------------------------------------------#
- exit
|