1# Copyright (c) 2022 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13mkdir /backdata 14mount /dev/block/by-name/userdata /backdata 15 16if [ -d "/backdata/updater/log/faultlog" ]; 17then 18 rm -rf /backdata/updater/log/faultlog/* 19 cp /data/log/faultlog/temp/cpp* /backdata/updater/log/faultlog 20else 21 mkdir /backdata/updater/log/faultlog 22 cp /data/log/faultlog/temp/cpp* /backdata/updater/log/faultlog 23fi 24 25if [ -d "/backdata/updater/log/hilog" ]; 26then 27 rm -rf /backdata/updater/log/hilog/* 28 cp /data/log/hilog/updater* /backdata/updater/log/hilog 29else 30 mkdir /backdata/updater/log/hilog 31 cp /data/log/hilog/updater* /backdata/updater/log/hilog 32fi 33