#若安裝出問題,請移除app後,再刪除以下資料庫資料,之後就可以正常安裝了 drop table oc_fulltextsearch_indexes; drop table oc_fulltextsearch_ticks; delete from oc_appconfig where appid='fulltextsearch'; delete from oc_appconfig where appid='fulltextsearch_elasticsearch'; delete from oc_appconfig where appid='files_fulltextsearch'; delete from oc_appconfig where appid='files_fulltextsearch_tesseract'; DELETE FROM oc_migrations WHERE app='fulltextsearch'; DELETE FROM oc_preferences WHERE appid='fulltextsearch';
# 例如某個連結失效了 https://cloud.test.com/s/T8wnofnnZjHk93e # 我們可以透過以下語法,找到哪個帳號停用了 select * from ( select uid_owner uid,ldap_dn name,token from oc_share,oc_ldap_user_mapping where uid_owner=owncloud_name union select uid_owner uid,displayname name,token from oc_share,oc_users where uid_owner=uid ) as NewUnionTable where token='T8wnofnnZjHk93e'
# 可計算同一天連線小時(小數第二位)
SELECT username ,DATE_FORMAT(start_date, "%Y%m%d") the_same_date, cast(sum(TIMESTAMPDIFF(MINUTE,start_date,end_date))/60 as decimal(9,2)) overtime_hour
from guacamole_connection_history
group by username,the_same_date
order by username,the_same_date desc
#若資料庫時區沒有調整,預設是UTC,可暫時使用CONVERT_TZ轉換正確時區
SELECT username ,DATE_FORMAT(CONVERT_TZ(start_date,'+00:00','+08:00'), "%Y%m%d") the_same_date, cast(sum(TIMESTAMPDIFF(MINUTE,start_date,end_date))/60 as decimal(9,2)) overtime_hour
from guacamole_connection_history
group by username,the_same_date
order by username,the_same_date desc
# 排除每次連線低於30分鐘
SELECT username ,DATE_FORMAT(start_date, "%Y%m%d") the_same_date, cast(sum(TIMESTAMPDIFF(MINUTE,start_date,end_date))/60 as decimal(9,2)) overtime_hour
from guacamole_connection_history
where TIMESTAMPDIFF(MINUTE,start_date,end_date) >= 30
group by username,the_same_date
order by username,the_same_date desc
#若資料庫時區沒有調整,預設是UTC,可暫時使用CONVERT_TZ轉換正確時區
SELECT username ,DATE_FORMAT(CONVERT_TZ(start_date,'+00:00','+08:00'), "%Y%m%d") the_same_date, cast(sum(TIMESTAMPDIFF(MINUTE,start_date,end_date))/60 as decimal(9,2)) overtime_hour
from guacamole_connection_history
where TIMESTAMPDIFF(MINUTE,start_date,end_date) >= 30
group by username,the_same_date
order by username,the_same_date desc
為了員工健康,要設定上線時間
另外酪梨醬預設60分鐘沒有任何遠端連線,會整個登出。 可搭配遠端桌面連線相關設定
vi guacamole.properties
##### 修改30分鐘整個網頁登出(必須在沒有任何連線的情況下)
api-session-timeout:30