CSH script does not show any output for non cPanel user

If the csh file not showing any output while executing a .csh file for a non cPanel user then it is because of the file “/etc/profile.d/locallib.csh” .

 

Apply the below fix for this ::

 

open the file : /etc/profile.d/locallib.csh and replace the code : eval $(perl -Mlocal::lib) with eval `perl -Mlocal::lib`

 

So it should show the output as ::

 

 cat /etc/profile.d/locallib.csh

#cPanel Added local::lib -- BEGIN
setenv LOCALLIBUSER $USER
if ( -e /usr/bin/whoami ) then
        setenv LOCALLIBUSER `whoami`
endif
if ( "$LOCALLIBUSER" != "root" ) then
    eval `perl -Mlocal::lib`
endif
#cPanel Added local::lib -- END

instead of

 

cat /etc/profile.d/locallib.csh

#cPanel Added local::lib -- BEGIN
setenv LOCALLIBUSER $USER
if ( -e /usr/bin/whoami ) then
setenv LOCALLIBUSER `whoami`
endif
if ( "$LOCALLIBUSER" != "root" ) then
eval $(perl -Mlocal::lib)
endif
#cPanel Added local::lib -- END

That’s all.

Table ‘psa.BackupsScheduled’ doesn’t exist

If you came across this error after upgrading the Plesk control panel or for any other reason then don’t panic as this can simply be resolved by following the below simple steps ::

Login to any other Plesk server and take a dump of the BackupsScheduled table

 

mysqldump psa BackupsScheduled > BackupsScheduled.sql -u admin -p`cat /etc/psa/.psa.shadow`

and once you have the .sql backup of the BackupsScheduled table then download the .sql backup file on the server where you are getting the error “Table ‘psa.BackupsScheduled’ doesn’t exist” and restore it .

 

mysql psa < BackupsScheduled.sql -u admin -p`cat /etc/psa/.psa.shadow`

Finally restart the MySQL service and you are done.

 

Backup Single Table from a database using MySQLdump

We normally backup entire database using mysqldump utility but what if only one table gets corrupt and you  only want to  restore  that table from backup.

In that case you can  use the below simple steps to backup and restore a single mysql table using   mysqldump utility ::

Backup ::

 mysqldump -u -p databasename tablename > tablename.sql

example ::

mysqldump  psa BackupsScheduled > BackupsScheduled.sql -u admin -p`cat /etc/psa/.psa.shadow`

Restoration ::

 mysql -u -p   databasename  <  tablename.sql

for example ::

mysql  psa < BackupsScheduled.sql -u admin -p`cat /etc/psa/.psa.shadow`

 

That’s all,  easy isn’t it.