I have this problem with bash in python. I want to make script that will make folder based on system date - and this works just fine. The problem is when I want to rsync two directories one with my files to backup and other that is created with system date in name.
import os
f = os.system("bash -c 'DATE=folder-`date +%y%m%d;mkdir /home/lol/$DATE;'")
g = os.system("bash -c 'rsync -av /folderToBackup/ /home/lol/$DATE/;'")
And when rsync copies files they all land in /home/lol/ not in /home/lol/$DATE
please if some one knows the solution, i tried different directories and rsynced files always land not in created folder with date but higher, for example in /home/lol/