Ubuntu 20.04는 매일 tar.gz.1을 생성합니다.

Ubuntu 20.04는 매일 tar.gz.1을 생성합니다.

Google에서 많은 검색을 수행하고 내 OS에서 많은 파일을 확인했지만 이에 대한 이유를 찾지 못했습니다.

두 개의 디렉토리가 있습니다.

/backup/
/backup2/

각각의 내용은 다음과 같습니다.

/backup:
total 897M
-rw-r--r-- 1 root root    0 Jun 26 00:00 2022-06-24_02_00_08-site1-db.tar.gz
-rw-r--r-- 1 root root 3.5M Jun 24 02:00 2022-06-24_02_00_08-site1-db.tar.gz.1
-rw-r--r-- 1 root root    0 Jun 26 00:00 2022-06-24_02_00_10-site1-files.tar.gz
-rw-r--r-- 1 root root 232M Jun 24 02:02 2022-06-24_02_00_10-site1-files.tar.gz.1
-rw-r--r-- 1 root root    0 Jun 26 00:00 2022-06-24_02_02_37-site2-db.tar.gz
-rw-r--r-- 1 root root 670K Jun 24 02:02 2022-06-24_02_02_37-site2-db.tar.gz.1
-rw-r--r-- 1 root root    0 Jun 26 00:00 2022-06-24_02_02_38-site2-files.tar.gz
-rw-r--r-- 1 root root 213M Jun 24 02:05 2022-06-24_02_02_38-site2-files.tar.gz.1
-rw-r--r-- 1 root root 3.5M Jun 25 02:00 2022-06-25_02_00_08-site1-db.tar.gz
-rw-r--r-- 1 root root 232M Jun 25 02:02 2022-06-25_02_00_10-site1-files.tar.gz
-rw-r--r-- 1 root root 670K Jun 25 02:02 2022-06-25_02_02_39-site2-db.tar.gz
-rw-r--r-- 1 root root 213M Jun 25 02:05 2022-06-25_02_02_39-site2-files.tar.gz
-rwxr-xr-x 1 root root  613 Jun 23 00:05 dump.sh
-rw-r--r-- 1 root root 2.0K Jun 25 02:02 error
-rw-r--r-- 1 root root   72 Jun 25 02:05 out

/backup2:
total 2.4G
-rw-r--r-- 1 root root 213M Jun 20 02:04 2022-06-20_02_02_05-site2-files.tar.gz
-rw-r--r-- 1 root root 3.4M Jun 21 02:00 2022-06-21_02_00_04-site1-db.tar.gz
-rw-r--r-- 1 root root 232M Jun 21 02:01 2022-06-21_02_00_06-site1-files.tar.gz
-rw-r--r-- 1 root root 668K Jun 21 02:01 2022-06-21_02_01_57-site2-db.tar.gz
-rw-r--r-- 1 root root 213M Jun 21 02:03 2022-06-21_02_01_57-site2-files.tar.gz
-rw-r--r-- 1 root root 3.4M Jun 22 02:00 2022-06-22_02_00_04-site1-db.tar.gz
-rw-r--r-- 1 root root 232M Jun 22 02:02 2022-06-22_02_00_06-site1-files.tar.gz
-rw-r--r-- 1 root root 671K Jun 22 02:02 2022-06-22_02_02_05-site2-db.tar.gz
-rw-r--r-- 1 root root 213M Jun 22 02:04 2022-06-22_02_02_05-site2-files.tar.gz
-rw-r--r-- 1 root root 3.5M Jun 23 02:00 2022-06-23_02_00_07-site1-db.tar.gz
-rw-r--r-- 1 root root 232M Jun 23 02:02 2022-06-23_02_00_10-site1-files.tar.gz
-rw-r--r-- 1 root root 671K Jun 23 02:02 2022-06-23_02_02_45-site2-db.tar.gz
-rw-r--r-- 1 root root 213M Jun 23 02:05 2022-06-23_02_02_45-site2-files.tar.gz
-rw-r--r-- 1 root root 3.5M Jun 24 02:00 2022-06-24_02_00_08-site1-db.tar.gz
-rw-r--r-- 1 root root 232M Jun 24 02:02 2022-06-24_02_00_10-site1-files.tar.gz
-rw-r--r-- 1 root root 670K Jun 24 02:02 2022-06-24_02_02_37-site2-db.tar.gz
-rw-r--r-- 1 root root 213M Jun 24 02:05 2022-06-24_02_02_38-site2-files.tar.gz
-rw-r--r-- 1 root root 3.5M Jun 25 02:00 2022-06-25_02_00_08-site1-db.tar.gz
-rw-r--r-- 1 root root 232M Jun 25 02:02 2022-06-25_02_00_10-site1-files.tar.gz
-rw-r--r-- 1 root root 671K Jun 25 02:02 2022-06-25_02_02_39-site2-db.tar.gz
-rw-r--r-- 1 root root 213M Jun 25 02:05 2022-06-25_02_02_39-site2-files.tar.gz
-rwxr-xr-x 1 root root  614 Jun 23 00:05 dump.sh
-rw-r--r-- 1 root root 1.4K Jun 25 02:02 error
-rw-r--r-- 1 root root   72 Jun 25 02:05 out

/backup/dump.sh:

echo 'it is started at' "$( date +%F_%H_%M_%S )"
backup_path='/backup/'

mongodump --db site1
name=$( date +%F_%H_%M_%S )
tar zPcf $backup_path$name-site1-db.tar.gz dump/
rm -rf dump
name=$( date +%F_%H_%M_%S )
tar zPcf $backup_path$name-site1-files.tar.gz /home/site1/

mongodump --db site2
name=$( date +%F_%H_%M_%S )
tar zPcf $backup_path$name-site2-db.tar.gz dump/
rm -rf dump
name=$( date +%F_%H_%M_%S )
tar zPcf $backup_path$name-site2-files.tar.gz /home/site1/

#find $backup_path*.tar.gz -mmin +2880 -exec rm -rvf {} \;
echo 'it is ended at' "$( date +%F_%H_%M_%S )"

/backup/error:

2022-06-25T02:00:02.672+0430    writing site1.objects to
2022-06-25T02:00:02.673+0430    writing site1.sessions to
2022-06-25T02:00:02.673+0430    writing site1.socket.io to
2022-06-25T02:00:02.691+0430    writing site1.searchpost to
2022-06-25T02:00:02.773+0430    done dumping site1.searchpost (206 documents)
2022-06-25T02:00:02.773+0430    writing site1.searchtopic to
2022-06-25T02:00:02.806+0430    done dumping site1.searchtopic (46 documents)
2022-06-25T02:00:02.877+0430    done dumping site1.socket.io (1118 documents)
2022-06-25T02:00:03.010+0430    done dumping site1.sessions (1866 documents)
2022-06-25T02:00:05.428+0430    [........................]  site1.objects  101/180874  (0.1%)
2022-06-25T02:00:07.861+0430    [########################]  site1.objects  180878/180874  (100.0%)
2022-06-25T02:00:07.917+0430    done dumping site1.objects (180878 documents)
2022-06-25T02:02:38.312+0430    writing site2.objects to
2022-06-25T02:02:38.344+0430    writing site2.sessions to
2022-06-25T02:02:38.345+0430    writing site2.searchpost to
2022-06-25T02:02:38.354+0430    writing site2.searchtopic to
2022-06-25T02:02:38.384+0430    done dumping site2.searchtopic (1 document)
2022-06-25T02:02:38.386+0430    done dumping site2.searchpost (1 document)
2022-06-25T02:02:38.433+0430    done dumping site2.sessions (261 documents)
2022-06-25T02:02:39.073+0430    done dumping site2.objects (40089 documents)
tar: dump/site2/sessions.bson: file changed as we read it
tar: dump/site2/searchtopic.bson: File removed before we read it
tar: dump/site2/searchpost.bson: File removed before we read it
tar: dump/site2/sessions.metadata.json: File removed before we read it
tar: dump/site2/objects.metadata.json: File removed before we read it
tar: dump/site2/searchpost.metadata.json: File removed before we read it
tar: dump/site2/searchtopic.metadata.json: File removed before we read it
tar: dump/site2: file changed as we read it
tar: dump: file changed as we read it

의 내용은 /backup2/error위와 동일 tar: dump ...하며 -P.

/backup/out:

it is started at 2022-06-25_02_00_02
it is ended at 2022-06-25_02_05_09

의 내용은 /backup2/dump.sh위와 동일하며 으로만 backup_path='/backup/'변경됩니다 backup_path='/backup2/'.

문제는 약 48시간 후에 발생하며 /backup/경로에서만 46시간보다 오래된 파일의 이름이 바뀌고 file.tar.gz.1또 다른 0바이트 파일이 생성됩니다.

이 작업을 수행할 crontab이 없으며 확인했지만 /etc/cron.hourly아무것도 /etc/cron.daily발견하지 못했습니다.

/backup이 문제는 디렉토리 에서만 발생하기 때문에 이상하다고 생각합니다 .

이 문제에 대한 아이디어나 해결책이 있습니까?

관련 정보